about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-01-29 13:18:11 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-01-29 13:18:24 +0100
commit84af03857acde8d9f347a629b79a7174e8e476a1 (patch)
tree1109ee2fd21d80d37a34c6d65fe40457ef1d63aa
parentcbf6ff980f73f3f4d89c6b8e5d04c95041d509b0 (diff)
downloadlr-84af03857acde8d9f347a629b79a7174e8e476a1.tar.gz
lr-84af03857acde8d9f347a629b79a7174e8e476a1.tar.xz
lr-84af03857acde8d9f347a629b79a7174e8e476a1.zip
parse_string: off-by-one for reallocation
-rw-r--r--lr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index 7f3d8aa..c7ac903 100644
--- a/lr.c
+++ b/lr.c
@@ -504,7 +504,7 @@ parse_string(char **s)
 		pos++;
 		while (*pos &&
 		    (*pos != '"' || (*pos == '"' && *(pos+1) == '"'))) {
-			if (len >= bufsiz) {
+			if (len + 1 >= bufsiz) {
 				bufsiz = 2*bufsiz + 16;
 				buf = realloc(buf, bufsiz);
 				if (!buf)