Avoid underflow if *size == 0.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@536 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
8e881dbdd7
commit
74c787f664
|
@ -61,7 +61,7 @@ openpam_straddch(char **str, size_t *size, size_t *len, int ch)
|
|||
*str = tmpstr;
|
||||
*size = tmpsize;
|
||||
*len = 0;
|
||||
} else if (*len >= *size - 1) {
|
||||
} else if (*len + 1 >= *size) {
|
||||
/* additional space required */
|
||||
tmpsize = *size * 2;
|
||||
if ((tmpstr = realloc(*str, tmpsize)) == NULL) {
|
||||
|
|
Loading…
Reference in New Issue