Fix input buffer allocation in XML parser (#270)

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-11-04 11:05:30 +01:00 committed by eboasson
parent 151159a5ea
commit d545551a60

View file

@ -198,7 +198,7 @@ static int make_chars_available (struct ddsrt_xmlp_state *st, size_t nmin)
}
}
/* buffer is owned by caller if fp = NULL, and by us if fp != NULL */
if (st->cbufp + st->cbufmax < nmin) {
if (st->cbufmax < st->cbufp + nmin) {
st->cbufmax = st->cbufp + nmin;
st->cbuf = ddsrt_realloc (st->cbuf, st->cbufmax);
}