1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_val

The strlen() could go past the end of a non-null terminated value
This commit is contained in:
Andrew Tridgell 2009-10-21 22:18:16 +11:00 committed by Andrew Bartlett
parent 16a80f1742
commit 1467e5eaab

View File

@ -98,7 +98,7 @@ struct ldb_dn *ldb_dn_from_ldb_val(void *mem_ctx,
if (! ldb) return NULL;
if (strdn && strdn->data
&& (strlen((const char*)strdn->data) != strdn->length)) {
&& (strnlen((const char*)strdn->data, strdn->length) != strdn->length)) {
/* The RDN must not contain a character with value 0x0 */
return NULL;
}