diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/samba/ldif_handlers.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source4/lib/ldb/samba/ldif_handlers.c b/source4/lib/ldb/samba/ldif_handlers.c index 46eac2295d..42f7605385 100644 --- a/source4/lib/ldb/samba/ldif_handlers.c +++ b/source4/lib/ldb/samba/ldif_handlers.c @@ -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); |