1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r6741: prevent talloc_strndup() from reading one byte past the end of a buffer,

giving valgrind errors
This commit is contained in:
Andrew Tridgell 2005-05-12 02:54:42 +00:00 committed by Gerald (Jerry) Carter
parent 6d15e95111
commit 7af0c547e0

View File

@ -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; }