git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b67385
)
r19080: Fix a potential NULL dereference
author
Volker Lendecke
<vlendec@samba.org>
Wed, 4 Oct 2006 21:07:05 +0000
(21:07 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 17:15:09 +0000
(12:15 -0500)
source/lib/util.c
patch
|
blob
|
history
diff --git
a/source/lib/util.c
b/source/lib/util.c
index e04ed977bb978095710d633bf1259b233bbf95eb..19c6cab5b28a5550f2889d9b4f3b99a1980bcc92 100644
(file)
--- a/
source/lib/util.c
+++ b/
source/lib/util.c
@@
-312,6
+312,13
@@
void add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
{
int i;
+ if ((*num_gids != 0) && (*gids == NULL)) {
+ /*
+ * A former call to this routine has failed to allocate memory
+ */
+ return;
+ }
+
for (i=0; i<*num_gids; i++) {
if ((*gids)[i] == gid)
return;