]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Minor update: stop reading XML doc on error
authorpcarana <pc.moreno2099@gmail.com>
Fri, 31 Jul 2020 18:18:46 +0000 (13:18 -0500)
committerpcarana <pc.moreno2099@gmail.com>
Fri, 31 Jul 2020 18:18:46 +0000 (13:18 -0500)
src/xml/relax_ng.c

index e917dd65e739319bc13c2c9a7012ad610d679e5e..a9ad9d0b6d0519f341dc46dd42e79d60756704d8 100644 (file)
@@ -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;