Fix issue of write after allocated buffer.

This commit is contained in:
Patrick Pelissier committed 2017-09-14 23:00:40 +02:00
1 parent 4c688c1004
commit ea60cd2ae6
1 file changed
+2 -2
+2 -2
View File
@@ -676,10 +676,10 @@ string_fget_word (string_t v, const char separator[], FILE *f)
if (strchr(separator, c) != NULL)
return retcode;
/* Next char is not a separator: continue parsing */
v->ptr[v->size++] = c;
v->ptr[v->size] = 0;
stringi_fit2size (v, v->alloc + v->alloc/2);
assert (v->alloc > v->size + 1);
v->ptr[v->size++] = c;
v->ptr[v->size] = 0;
}
return retcode;
}