git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a163284
)
wbclient: gr_mem can be NULL
author
Andrew Tridgell
<tridge@samba.org>
Thu, 16 Sep 2010 10:12:20 +0000
(20:12 +1000)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 16 Sep 2010 11:09:18 +0000
(21:09 +1000)
if the structure was partly created and an error occurred, then don't
crash
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
nsswitch/libwbclient/wbc_pwd.c
patch
|
blob
|
history
diff --git
a/nsswitch/libwbclient/wbc_pwd.c
b/nsswitch/libwbclient/wbc_pwd.c
index c7bfdb8fd88305e8a76f967b1838f85461d78591..1527808d888d98eb581ccdee5a8eafccb9455e75 100644
(file)
--- a/
nsswitch/libwbclient/wbc_pwd.c
+++ b/
nsswitch/libwbclient/wbc_pwd.c
@@
-100,6
+100,11
@@
static void wbcGroupDestructor(void *ptr)
free(gr->gr_name);
free(gr->gr_passwd);
+ /* if the array was partly created this can be NULL */
+ if (gr->gr_mem == NULL) {
+ return;
+ }
+
for (i=0; gr->gr_mem[i] != NULL; i++) {
free(gr->gr_mem[i]);
}