The Samba-Bugzilla – Attachment 12089 Details for
Bug 11912
NTLM Authentication issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Possible patch for master
tmp.diff.txt (text/plain), 2.19 KB, created by
Stefan Metzmacher
on 2016-05-09 15:59:15 UTC
(
hide
)
Description:
Possible patch for master
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2016-05-09 15:59:15 UTC
Size:
2.19 KB
patch
obsolete
>From aa2c42a079fd320ab87eb65da3947ab103c08a07 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Mon, 9 May 2016 16:14:31 +0200 >Subject: [PATCH] libcli/auth: let msrpc_parse() return talloc'ed empty strings > >This make it more predictable for the callers. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11912 >BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1334356 >BUG: https://launchpad.net/bugs/1578576 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >--- > libcli/auth/msrpc_parse.c | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > >diff --git a/libcli/auth/msrpc_parse.c b/libcli/auth/msrpc_parse.c >index d499d9e..74a7bcc 100644 >--- a/libcli/auth/msrpc_parse.c >+++ b/libcli/auth/msrpc_parse.c >@@ -262,7 +262,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx, > > ps = va_arg(ap, char **); > if (len1 == 0 && len2 == 0) { >- *ps = (char *)discard_const(""); >+ *ps = talloc_strdup(mem_ctx, ""); >+ if (*ps == NULL) { >+ ret = false; >+ goto cleanup; >+ } > } else { > /* make sure its in the right format - be strict */ > if ((len1 != len2) || (ptr + len1 < ptr) || (ptr + len1 < len1) || (ptr + len1 > blob->length)) { >@@ -289,7 +293,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx, > goto cleanup; > } > } else { >- (*ps) = (char *)discard_const(""); >+ *ps = talloc_strdup(mem_ctx, ""); >+ if (*ps == NULL) { >+ ret = false; >+ goto cleanup; >+ } > } > } > break; >@@ -302,7 +310,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx, > ps = (char **)va_arg(ap, char **); > /* make sure its in the right format - be strict */ > if (len1 == 0 && len2 == 0) { >- *ps = (char *)discard_const(""); >+ *ps = talloc_strdup(mem_ctx, ""); >+ if (*ps == NULL) { >+ ret = false; >+ goto cleanup; >+ } > } else { > if ((len1 != len2) || (ptr + len1 < ptr) || (ptr + len1 < len1) || (ptr + len1 > blob->length)) { > ret = false; >@@ -325,7 +337,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx, > goto cleanup; > } > } else { >- (*ps) = (char *)discard_const(""); >+ *ps = talloc_strdup(mem_ctx, ""); >+ if (*ps == NULL) { >+ ret = false; >+ goto cleanup; >+ } > } > } > break; >-- >1.9.1 >
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
Flags:
gd
:
review+
Actions:
View
Attachments on
bug 11912
: 12089 |
12091
|
12092
|
12093