From: Arran Cudbard-Bell Date: Wed, 6 Mar 2019 11:23:52 +0000 (+0800) Subject: Fix edge case with fr_vasprintf X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ff027a3d9d30bb19ee15e1ebd33b681b4521570;p=thirdparty%2Ffreeradius-server.git Fix edge case with fr_vasprintf %pV:%u would print the boxed value and a pointer to the box. --- diff --git a/src/lib/util/print.c b/src/lib/util/print.c index e587e1da406..5452ffa7dcc 100644 --- a/src/lib/util/print.c +++ b/src/lib/util/print.c @@ -699,7 +699,6 @@ char *fr_vasprintf(TALLOC_CTX *ctx, char const *fmt, va_list ap) out = out_tmp; va_end(ap_p); /* one time use only */ - va_copy(ap_p, ap_q); /* already advanced to the next argument */ } else { out_tmp = talloc_strdup_append_buffer(out, subst); TALLOC_FREE(subst); @@ -707,6 +706,8 @@ char *fr_vasprintf(TALLOC_CTX *ctx, char const *fmt, va_list ap) out = out_tmp; } + va_copy(ap_p, ap_q); /* already advanced to the next argument */ + fmt_p = p + 1; } break;