mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r19520: Try not to read past the end of the ldb buffer.
Andrew Bartlett
This commit is contained in:
parent
dbe5e8dd8c
commit
3a103149a6
@ -80,10 +80,12 @@ static int ldif_write_objectSid(struct ldb_context *ldb, void *mem_ctx,
|
||||
|
||||
static BOOL ldb_comparision_objectSid_isString(const struct ldb_val *v)
|
||||
{
|
||||
/* see if the input if null-terninated */
|
||||
if (v->data[v->length] != '\0') return False;
|
||||
|
||||
if (v->length < 3) {
|
||||
return False;
|
||||
}
|
||||
|
||||
if (strncmp("S-", (const char *)v->data, 2) != 0) return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
@ -179,9 +181,6 @@ static BOOL ldb_comparision_objectGUID_isString(const struct ldb_val *v)
|
||||
struct GUID guid;
|
||||
NTSTATUS status;
|
||||
|
||||
/* see if the input if null-terninated */
|
||||
if (v->data[v->length] != '\0') return False;
|
||||
|
||||
if (v->length < 33) return False;
|
||||
|
||||
status = GUID_from_string((const char *)v->data, &guid);
|
||||
|
Loading…
Reference in New Issue
Block a user