From 1467e5eaab24b2b5c90ba0dd4e9dad4f321568c3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Oct 2009 22:18:16 +1100 Subject: 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 --- source4/lib/ldb/common/ldb_dn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index fa3865e77f..2ba17b2a6b 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -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; } -- cgit