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:
parent
6d15e95111
commit
7af0c547e0
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user