Mercurial > dovecot > original-hg > dovecot-1.2
changeset 1838:6e834ae1da0e HEAD
p_strndup() read str[max_chars] byte - could have possibly crashed in some
rare conditions
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 23 Oct 2003 11:30:04 +0300 |
parents | b730eeca8861 |
children | 364b1e992154 |
files | src/lib/strfuncs.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/strfuncs.c Tue Oct 21 17:14:56 2003 +0300 +++ b/src/lib/strfuncs.c Thu Oct 23 11:30:04 2003 +0300 @@ -168,7 +168,7 @@ return NULL; len = 0; - while (((const char *) str)[len] != '\0' && len < max_chars) + while (len < max_chars && ((const char *) str)[len] != '\0') len++; mem = p_malloc(pool, len+1);