X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fauths%2Fxtextencode.c;h=30ff8f11ddb039401f34d74c1e2ccfea0e1210ff;hb=afd5e75ffc8f64f0ebed1df9dce64793011c14a6;hp=7cdfe322495504d9fe5b1890c7b380299e948e28;hpb=3634fc257bd0667daef14d72005cd87c735bbb24;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/auths/xtextencode.c b/src/src/auths/xtextencode.c index 7cdfe3224..30ff8f11d 100644 --- a/src/src/auths/xtextencode.c +++ b/src/src/auths/xtextencode.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2009 */ +/* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ #include "../exim.h" @@ -28,7 +28,7 @@ uschar * auth_xtextencode(uschar *clear, int len) { uschar *code; -uschar *p = (uschar *)clear; +uschar *p = US clear; uschar *pp; int c = len; int count = 1; @@ -40,19 +40,15 @@ in order to get the right amount of store. */ while (c -- > 0) count += ((x = *p++) < 33 || x > 127 || x == '+' || x == '=')? 3 : 1; -pp = code = store_get(count); +pp = code = store_get(count, is_tainted(clear)); -p = (uschar *)clear; +p = US clear; c = len; while (c-- > 0) - { if ((x = *p++) < 33 || x > 127 || x == '+' || x == '=') - { - sprintf(CS pp, "+%.02x", x); /* There's always room */ - pp += 3; - } - else *pp++ = x; - } + pp += sprintf(CS pp, "+%.02x", x); /* There's always room */ + else + *pp++ = x; *pp = 0; return code;