X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fdummies.c;h=197415f0ccd6a4c0fa6e113071709401d9897ac5;hb=fc55624df0c1956b7b6b4ae35605a6b95704d022;hp=2e1ad11f5864fb1c1e24a9ba3bba3a9248719bbb;hpb=d12746bc15d83ab821be36975da0179672708bc1;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/dummies.c b/src/src/dummies.c index 2e1ad11f5..197415f0c 100644 --- a/src/src/dummies.c +++ b/src/src/dummies.c @@ -20,7 +20,7 @@ alternates. */ /* We don't have the full Exim headers dragged in, but this function is used for debugging output. */ -extern gstring * string_vformat(gstring *, BOOL, const char *, va_list); +extern gstring * string_vformat(gstring *, unsigned, const char *, va_list); /************************************************* @@ -56,7 +56,9 @@ flags = flags; * Handle calls to print debug output * *************************************************/ -/* The message just gets written to stderr +/* The message just gets written to stderr. +We use tainted memory to format into just so that we can handle +tainted arguments. Arguments: format a printf() format @@ -69,12 +71,12 @@ void debug_printf(char *format, ...) { va_list ap; -gstring * g = string_get(1024); -void * reset_point = g; +rmark reset_point = store_mark(); +gstring * g = string_get_tainted(1024, TRUE); va_start(ap, format); -if (!string_vformat(g, FALSE, format, ap)) +if (!string_vformat(g, 0, format, ap)) { char * s = "**** debug string overflowed buffer ****\n"; char * p = CS g->s + g->ptr;