[PATCH] 3-for-1 mini-patch
ZINKEVICIUS,MATT (HP-Loveland,ex1)
matt_zinkevicius at hp.com
Mon Aug 6 10:41:27 GMT 2001
Self explanatory. Not exactly bugs, just more correct:
--- samba-2.2.1-orig/source/rpc_parse/parse_sec.c Tue Jun 26 06:31:41
2001
+++ samba-2.2.1-acldb/source/rpc_parse/parse_sec.c Thu Aug 2 04:29:17
2001
@@ -138,11 +138,10 @@
/* Now we need to return a non-NULL address for the ace list even
if the number of aces required is zero. This is because there
is a distinct difference between a NULL ace and an ace with zero
- entries in it. This is achieved by always making the number of
- bytes allocated by talloc() positive. Heh. */
+ entries in it. This is achieved by checking that num_aces is a
+ positive number. */
- if((dst->ace = (SEC_ACE *)talloc(ctx, sizeof(SEC_ACE) * num_aces +
1))
- == NULL) {
+ if((num_aces) && ((dst->ace = (SEC_ACE *)talloc(ctx, sizeof(SEC_ACE)
* num_aces )) == NULL)) {
return NULL;
}
@@ -298,9 +297,10 @@
{
int i, j;
- /* Trivial case */
+ /* Trivial cases */
if (!s1 && !s2) return True;
+ if (!s1 || !s2) return False;
/* Check top level stuff */
@@ -544,7 +544,7 @@
offset = SD_HEADER_SIZE;
dst->off_sacl = offset;
- offset += ((sacl->size + 3) & ~3);
+ offset += ((dst->sacl->size + 3) & ~3);
}
if (dst->dacl != NULL) {
@@ -553,7 +553,7 @@
offset = SD_HEADER_SIZE;
dst->off_dacl = offset;
- offset += ((dacl->size + 3) & ~3);
+ offset += ((dst->dacl->size + 3) & ~3);
}
Matt Zinkevicius
Modular Network Storage
Hewlett-Packard
More information about the samba-technical
mailing list