git.samba.org
/
bbaumbach
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acc81f9
)
s4-ldb: fixed a crash bug for non-UTF8 strings
author
Andrew Tridgell
<tridge@samba.org>
Mon, 12 Apr 2010 08:39:50 +0000
(18:39 +1000)
committer
Andrew Tridgell
<tridge@samba.org>
Mon, 12 Apr 2010 09:12:37 +0000
(19:12 +1000)
when one of the strings was not valid UTF8, we would try to
dereference NULL
source4/lib/ldb/common/attrib_handlers.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/common/attrib_handlers.c
b/source4/lib/ldb/common/attrib_handlers.c
index 2a2bd0852e594d5931e82d17972463f89aeed3e6..2f4454c7b41eae4351395c868b269b9d03f751af 100644
(file)
--- a/
source4/lib/ldb/common/attrib_handlers.c
+++ b/
source4/lib/ldb/common/attrib_handlers.c
@@
-269,7
+269,8
@@
utf8str:
* options but to do a binary compare */
talloc_free(b1);
talloc_free(b2);
- if (memcmp(s1, s2, MIN(n1, n2)) == 0) {
+ ret = memcmp(s1, s2, MIN(n1, n2));
+ if (ret == 0) {
if (n1 == n2) return 0;
if (n1 > n2) {
return (int)toupper(s1[n2]);
@@
-277,6
+278,7
@@
utf8str:
return -(int)toupper(s2[n1]);
}
}
+ return ret;
}
u1 = b1;