summaryrefslogtreecommitdiffstats
path: root/patches/xmlstarlet-1.0.1/0003-xmlstarlet-bail-out-if-no-dtd-parsing-support-in-lib.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/xmlstarlet-1.0.1/0003-xmlstarlet-bail-out-if-no-dtd-parsing-support-in-lib.patch')
-rw-r--r--patches/xmlstarlet-1.0.1/0003-xmlstarlet-bail-out-if-no-dtd-parsing-support-in-lib.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/xmlstarlet-1.0.1/0003-xmlstarlet-bail-out-if-no-dtd-parsing-support-in-lib.patch b/patches/xmlstarlet-1.0.1/0003-xmlstarlet-bail-out-if-no-dtd-parsing-support-in-lib.patch
new file mode 100644
index 000000000..d61682c5e
--- /dev/null
+++ b/patches/xmlstarlet-1.0.1/0003-xmlstarlet-bail-out-if-no-dtd-parsing-support-in-lib.patch
@@ -0,0 +1,33 @@
+From: Robert Schwebel <r.schwebel@pengutronix.de>
+Date: Sun, 29 Nov 2009 00:00:00 +0100
+Subject: [PATCH] xmlstarlet: bail out if no dtd parsing support in libxml2
+
+We use xmlParseDTD without testing if libxml2 has support
+for it enabled. This can result in the following linker error:
+
+xml_validate.o: In function `valAgainstDtd':
+xmlstarlet-1.0.1/src/xml_validate.c:229:
+undefined reference to `xmlParseDTD'
+
+Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
+Applied-Upstream: 1.0.2, commit:5f2a71f57c1500b98ee2d1f9f6757854349e0072
+---
+ src/xml_validate.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/xml_validate.c b/src/xml_validate.c
+index 911bb16d1d5f..a7f55b8da864 100644
+--- a/src/xml_validate.c
++++ b/src/xml_validate.c
+@@ -226,6 +226,11 @@ valAgainstDtd(valOptionsPtr ops, char* dtdvalid, xmlDocPtr doc, char* filename)
+ {
+ xmlDtdPtr dtd;
+
++#if !defined(LIBXML_VALID_ENABLED)
++ xmlGenericError(xmlGenericErrorContext,
++ "libxml2 has no validation support");
++ return 2;
++#endif
+ dtd = xmlParseDTD(NULL, (const xmlChar *)dtdvalid);
+ if (dtd == NULL)
+ {