git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29ef1b2
)
s4:ldb Use length-limited printf to avoid walking off end of strings
author
Andrew Bartlett
<abartlet@samba.org>
Wed, 19 Aug 2009 03:26:34 +0000
(13:26 +1000)
committer
Andrew Bartlett
<abartlet@samba.org>
Fri, 21 Aug 2009 07:50:50 +0000
(17:50 +1000)
This should ensure the debug messages do not have random characters at
their ends.
Andrew Bartlett
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 3ea9857d52e8fc43e70406ec03d0f0372d31f948..53795fdbd34ea71acea925121504fb0a1a108ec2 100644
(file)
--- a/
source4/lib/ldb/common/attrib_handlers.c
+++ b/
source4/lib/ldb/common/attrib_handlers.c
@@
-62,7
+62,7
@@
int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
out->data = (uint8_t *)ldb_casefold(ldb, mem_ctx, (const char *)(in->data), in->length);
if (out->data == NULL) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_handler_fold: unable to casefold string [%
s]",
in->data);
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_handler_fold: unable to casefold string [%
.*s]", (int)in->length, (const char *)
in->data);
return -1;
}