git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac19b39
)
s3: Protect tldap_errstr against a NULL ld
author
Volker Lendecke
<vl@samba.org>
Sun, 20 Feb 2011 14:08:41 +0000
(15:08 +0100)
committer
Volker Lendecke
<vl@samba.org>
Sun, 20 Feb 2011 14:59:48 +0000
(15:59 +0100)
source3/lib/tldap_util.c
patch
|
blob
|
history
diff --git
a/source3/lib/tldap_util.c
b/source3/lib/tldap_util.c
index b83a1b75f0248435d7eac843538d746baf953632..8f7ad883ef131d3a3e9098bebd401f90875591cc 100644
(file)
--- a/
source3/lib/tldap_util.c
+++ b/
source3/lib/tldap_util.c
@@
-337,7
+337,9
@@
const char *tldap_errstr(TALLOC_CTX *mem_ctx, struct tldap_context *ld, int rc)
const char *ld_error = NULL;
char *res;
- ld_error = tldap_msg_diagnosticmessage(tldap_ctx_lastmsg(ld));
+ if (ld != NULL) {
+ ld_error = tldap_msg_diagnosticmessage(tldap_ctx_lastmsg(ld));
+ }
res = talloc_asprintf(mem_ctx, "LDAP error %d (%s), %s", rc,
tldap_err2string(rc),
ld_error ? ld_error : "unknown");