Imported Upstream version 2.9.4
[platform/upstream/libxml2.git] / error.c
diff --git a/error.c b/error.c
index cbcf5c9..9606f13 100644 (file)
--- a/error.c
+++ b/error.c
@@ -18,7 +18,7 @@
 
 void XMLCDECL xmlGenericErrorDefaultFunc       (void *ctx ATTRIBUTE_UNUSED,
                                 const char *msg,
-                                ...);
+                                ...) LIBXML_ATTR_FORMAT(2,3);
 
 #define XML_GET_VAR_STR(msg, str) {                            \
     int       size, prev_size = -1;                            \
@@ -177,7 +177,9 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
     xmlChar  content[81]; /* space for 80 chars + line terminator */
     xmlChar *ctnt;
 
-    if (input == NULL) return;
+    if ((input == NULL) || (input->cur == NULL))
+        return;
+
     cur = input->cur;
     base = input->base;
     /* skip backwards over any end-of-lines */