Varargs require that any list started has to be ended From: Erik Hovland On x86 terminating va_list is not a problem. That macro is nothing. But on other architectures (like PowerPC) the macro is typically required. --- lib/torture/torture.c | 2 ++ source4/auth/ntlmssp/ntlmssp_parse.c | 4 ++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/lib/torture/torture.c b/lib/torture/torture.c index 17adce9..99447e7 100644 --- a/lib/torture/torture.c +++ b/lib/torture/torture.c @@ -107,6 +107,7 @@ void torture_comment(struct torture_context *context, const char *comment, ...) va_start(ap, comment); tmp = talloc_vasprintf(context, comment, ap); + va_end(ap); context->results->ui_ops->comment(context, tmp); @@ -126,6 +127,7 @@ void torture_warning(struct torture_context *context, const char *comment, ...) va_start(ap, comment); tmp = talloc_vasprintf(context, comment, ap); + va_end(ap); context->results->ui_ops->warning(context, tmp); diff --git a/source4/auth/ntlmssp/ntlmssp_parse.c b/source4/auth/ntlmssp/ntlmssp_parse.c index d606b8d..13e7eaf 100644 --- a/source4/auth/ntlmssp/ntlmssp_parse.c +++ b/source4/auth/ntlmssp/ntlmssp_parse.c @@ -67,6 +67,7 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx, head_size += 8; n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s); if (n == -1) { + va_end(ap); return false; } pointers[i].length = n; @@ -78,6 +79,7 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx, head_size += 8; n = push_ascii_talloc(pointers, (char **)&pointers[i].data, s); if (n == -1) { + va_end(ap); return false; } pointers[i].length = n; @@ -90,6 +92,7 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx, s = va_arg(ap, char *); n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s); if (n == -1) { + va_end(ap); return false; } pointers[i].length = n; @@ -183,6 +186,7 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx, /* a helpful macro to avoid running over the end of our blob */ #define NEED_DATA(amount) \ if ((head_ofs + amount) > blob->length) { \ + va_end(ap); \ return false; \ }