The Samba-Bugzilla – Attachment 3946 Details for
Bug 6129
va_start always needs a va_end, missing in some instances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Makes sure va_end is called no matter what condition
varargs-correctness.patch (text/plain), 2.12 KB, created by
Erik Hovland
on 2009-02-19 15:57:15 UTC
(
hide
)
Description:
Makes sure va_end is called no matter what condition
Filename:
MIME Type:
Creator:
Erik Hovland
Created:
2009-02-19 15:57:15 UTC
Size:
2.12 KB
patch
obsolete
>Varargs require that any list started has to be ended > >From: Erik Hovland <erik@hovland.org> > >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; \ > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6129
:
3946
|
4281