]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't use fixed-size buffers
authorAlan T. DeKok <aland@freeradius.org>
Wed, 30 Dec 2015 16:43:58 +0000 (11:43 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 30 Dec 2015 16:44:54 +0000 (11:44 -0500)
src/main/xlat.c

index b07388485ecd95819067e8245a6513813591034e..d52701550a321c91434200b185b49935f58fa468 100644 (file)
@@ -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;
        }