[libxml2] xmllint should not load DTD by default when using the reader



commit e4d16d7909d5c9bbff5dc45a19bb75c3269b4f70
Author: Daniel Veillard <veillard redhat com>
Date:   Fri Dec 21 10:58:14 2012 +0800

    xmllint should not load DTD by default when using the reader

 xmllint.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/xmllint.c b/xmllint.c
index 2b97609..08e53ef 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -1875,7 +1875,8 @@ static void streamFile(char *filename) {
 	    xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
 	else
 #endif /* LIBXML_VALID_ENABLED */
-	    xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
+	    if (loaddtd)
+		xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
 #ifdef LIBXML_SCHEMAS_ENABLED
 	if (relaxng != NULL) {
 	    if ((timing) && (!repeat)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]