diff options
author | teor <teor@torproject.org> | 2019-08-12 09:41:14 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-08-12 09:41:14 +1000 |
commit | 9be65c440baae43dd38ffef216f6198c714ba5ba (patch) | |
tree | ec21442c9ea9cd8185ce0d219c2fe0660f0ac4ec /src | |
parent | 955cf9620c68c17f6531e80f9f4a7fa7d9f0f479 (diff) | |
parent | 2cdc6b2005d2ad09b44cf9a455a70f258e7f6fca (diff) | |
download | tor-9be65c440baae43dd38ffef216f6198c714ba5ba.tar.gz tor-9be65c440baae43dd38ffef216f6198c714ba5ba.zip |
Merge remote-tracking branch 'tor-github/pr/926' into maint-0.3.5
Diffstat (limited to 'src')
-rw-r--r-- | src/ext/getdelim.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ext/getdelim.c b/src/ext/getdelim.c index 8254103ff9..1c29baffd9 100644 --- a/src/ext/getdelim.c +++ b/src/ext/getdelim.c @@ -67,7 +67,8 @@ compat_getdelim_(char **buf, size_t *bufsiz, int delimiter, FILE *fp) char *nbuf; size_t nbufsiz = *bufsiz * 2; ssize_t d = ptr - *buf; - if ((nbuf = raw_realloc(*buf, nbufsiz)) == NULL) + if (nbufsiz < *bufsiz || + (nbuf = raw_realloc(*buf, nbufsiz)) == NULL) return -1; *buf = nbuf; *bufsiz = nbufsiz; |