summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-05-22 20:20:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:43 -0500
commit71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a (patch)
tree873d148c4731b4d909d3bc1f50ddab49f5849182 /source3/libads
parent725e90f1572be8734c321a3d638abdf778038349 (diff)
downloadsamba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.tar.gz
samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.tar.bz2
samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.zip
r23080: Fix bug #4637 - we hads missed some cases where
we were calling PRS_ALLOC_MEM with zero count. Jeremy. (This used to be commit 9a10736e6fa276ca4b0726fbb7baf0daafbdc46d)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/authdata.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
index 71294941a6..8e951dde80 100644
--- a/source3/libads/authdata.c
+++ b/source3/libads/authdata.c
@@ -120,10 +120,14 @@ static BOOL pac_io_krb_sid_and_attr_array(const char *desc,
return False;
if (UNMARSHALLING(ps)) {
- array->krb_sid_and_attrs = PRS_ALLOC_MEM(ps, KRB_SID_AND_ATTRS, num);
- if (!array->krb_sid_and_attrs) {
- DEBUG(3, ("No memory available\n"));
- return False;
+ if (num) {
+ array->krb_sid_and_attrs = PRS_ALLOC_MEM(ps, KRB_SID_AND_ATTRS, num);
+ if (!array->krb_sid_and_attrs) {
+ DEBUG(3, ("No memory available\n"));
+ return False;
+ }
+ } else {
+ array->krb_sid_and_attrs = NULL;
}
}
@@ -184,10 +188,14 @@ static BOOL pac_io_group_membership_array(const char *desc,
return False;
if (UNMARSHALLING(ps)) {
- array->group_membership = PRS_ALLOC_MEM(ps, GROUP_MEMBERSHIP, num);
- if (!array->group_membership) {
- DEBUG(3, ("No memory available\n"));
- return False;
+ if (num) {
+ array->group_membership = PRS_ALLOC_MEM(ps, GROUP_MEMBERSHIP, num);
+ if (!array->group_membership) {
+ DEBUG(3, ("No memory available\n"));
+ return False;
+ }
+ } else {
+ array->group_membership = NULL;
}
}
@@ -456,10 +464,14 @@ static BOOL pac_io_pac_signature_data(const char *desc,
return False;
if (UNMARSHALLING(ps) && length) {
- data->signature.buffer = PRS_ALLOC_MEM(ps, uint8, siglen);
- if (!data->signature.buffer) {
- DEBUG(3, ("No memory available\n"));
- return False;
+ if (siglen) {
+ data->signature.buffer = PRS_ALLOC_MEM(ps, uint8, siglen);
+ if (!data->signature.buffer) {
+ DEBUG(3, ("No memory available\n"));
+ return False;
+ }
+ } else {
+ data->signature.buffer = NULL;
}
}