From: pcarana Date: Fri, 31 Jul 2020 18:18:46 +0000 (-0500) Subject: Minor update: stop reading XML doc on error X-Git-Tag: v1.4.0~5 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b06a0292ad1d35e580b911cc1d8d93f5aa540749;p=thirdparty%2FFORT-validator.git Minor update: stop reading XML doc on error --- diff --git a/src/xml/relax_ng.c b/src/xml/relax_ng.c index e917dd65..a9ad9d0b 100644 --- a/src/xml/relax_ng.c +++ b/src/xml/relax_ng.c @@ -119,6 +119,11 @@ relax_ng_parse(const char *path, xml_read_cb cb, void *arg) NULL); while ((read = xmlTextReaderRead(reader)) == 1) { + if (xmlTextReaderIsValid(reader) <= 0) { + error = pr_val_err("XML document isn't valid."); + goto free_valid_ctx; + } + error = cb(reader, arg); if (error) goto free_valid_ctx;