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:
6d15e95
)
r6741: prevent talloc_strndup() from reading one byte past the end of a buffer,
author
Andrew Tridgell
<tridge@samba.org>
Thu, 12 May 2005 02:54:42 +0000
(
02:54
+0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 18:16:40 +0000
(13:16 -0500)
giving valgrind errors
source/lib/talloc/talloc.c
patch
|
blob
|
history
diff --git
a/source/lib/talloc/talloc.c
b/source/lib/talloc/talloc.c
index 3650ab7f51b7469aca378a6bf8ebe5b54a776a0d..46abd89bac5e49c64ee05dc49abb8c8d8c59e294 100644
(file)
--- a/
source/lib/talloc/talloc.c
+++ b/
source/lib/talloc/talloc.c
@@
-919,7
+919,7
@@
char *talloc_strndup(const void *t, const char *p, size_t n)
size_t len;
char *ret;
- for (len=0;
p[len] && len<n
; len++) ;
+ for (len=0;
len<n && p[len]
; len++) ;
ret = _talloc(t, len + 1);
if (!ret) { return NULL; }