git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16a80f1
)
s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_val
author
Andrew Tridgell
<tridge@samba.org>
Wed, 21 Oct 2009 11:18:16 +0000
(22:18 +1100)
committer
Andrew Bartlett
<abartlet@samba.org>
Wed, 21 Oct 2009 11:43:58 +0000
(22:43 +1100)
The strlen() could go past the end of a non-null terminated value
source4/lib/ldb/common/ldb_dn.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/common/ldb_dn.c
b/source4/lib/ldb/common/ldb_dn.c
index fa3865e77f42daee248b4c4a8586b99c1a9f5d2d..2ba17b2a6b29595279a4d34ca35f916af4ae7385 100644
(file)
--- 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
- && (str
len((const char*)strdn->data
) != strdn->length)) {
+ && (str
nlen((const char*)strdn->data, strdn->length
) != strdn->length)) {
/* The RDN must not contain a character with value 0x0 */
return NULL;
}