apply fix from Stefan Kost to avoid a crash in xmllint, fixes 504284

* xmllint.c: apply fix from Stefan Kost to avoid a crash
  in xmllint, fixes 504284
Daniel

svn path=/trunk/; revision=3673
diff --git a/ChangeLog b/ChangeLog
index febc7c5..a1f77c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 11 14:48:40 CST 2008 Daniel Veillard <daniel@veillard.com>
+
+	* xmllint.c: apply fix from Stefan Kost to avoid a crash
+	  in xmllint, fixes 504284
+
 Fri Jan 11 14:39:03 CST 2008 Daniel Veillard <daniel@veillard.com>
 
 	* xml2-config.in: apply patch from Fred Crozat to avoid
diff --git a/xmllint.c b/xmllint.c
index 5c27eb2..ee41697 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -257,7 +257,7 @@
     const char *lastsegment = URL;
     const char *iter = URL;
 
-    if (nbpaths > 0) {
+    if ((nbpaths > 0) && (iter != NULL)) {
 	while (*iter != 0) {
 	    if (*iter == '/')
 		lastsegment = iter + 1;