mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r22673: Fix for Jerry's reversion. We still need to check size
before talloc.
Jeremy.
(This used to be commit 9e4c6ab739
)
This commit is contained in:
parent
e468268335
commit
32b9beb164
@ -4838,10 +4838,15 @@ BOOL samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
|
||||
if(!prs_uint32("num_sids1", ps, depth, &r_u->num_sids1))
|
||||
return False;
|
||||
|
||||
/* We must always use talloc here even when marshalling. */
|
||||
if (r_u->num_sids1) {
|
||||
ptr_sid = TALLOC_ARRAY(ps->mem_ctx, uint32, r_u->num_sids1);
|
||||
if (!ptr_sid) {
|
||||
return False;
|
||||
}
|
||||
} else {
|
||||
ptr_sid = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < r_u->num_sids1; i++) {
|
||||
ptr_sid[i] = 1;
|
||||
@ -4850,7 +4855,14 @@ BOOL samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
|
||||
}
|
||||
|
||||
if (UNMARSHALLING(ps)) {
|
||||
if (r_u->num_sids1) {
|
||||
r_u->sid = TALLOC_ARRAY(ps->mem_ctx, DOM_SID2, r_u->num_sids1);
|
||||
if (!r_u->sid) {
|
||||
return False;
|
||||
}
|
||||
} else {
|
||||
r_u->sid = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < r_u->num_sids1; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user