From d545551a60a4fa10d1657b36d5bc255081cf7274 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Mon, 4 Nov 2019 11:05:30 +0100 Subject: [PATCH] Fix input buffer allocation in XML parser (#270) Signed-off-by: Erik Boasson --- src/ddsrt/src/xmlparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ddsrt/src/xmlparser.c b/src/ddsrt/src/xmlparser.c index cd3580f..c497624 100644 --- a/src/ddsrt/src/xmlparser.c +++ b/src/ddsrt/src/xmlparser.c @@ -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); }