From: Alan T. DeKok Date: Wed, 30 Dec 2015 16:43:58 +0000 (-0500) Subject: don't use fixed-size buffers X-Git-Tag: release_3_0_11~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d56c079b80ffeddb702b28343b9efd39a125598a;p=thirdparty%2Ffreeradius-server.git don't use fixed-size buffers --- diff --git a/src/main/xlat.c b/src/main/xlat.c index b07388485ec..d52701550a3 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -2362,10 +2362,13 @@ static char *xlat_aprint(TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const * c * Escape the non-literals we found above. */ if (str && escape) { + size_t len; char *escaped; - escaped = talloc_array(ctx, char, 2048); /* FIXME: do something intelligent */ - escape(request, escaped, 2038, str, escape_ctx); + len = talloc_array_length(str) * 3; + + escaped = talloc_array(ctx, char, len); + escape(request, escaped, len, str, escape_ctx); talloc_free(str); str = escaped; }