A few more safety cleanup raised by scan
* SAX2.c encoding.c parser.c xmlschemas.c: a few more safety checks
* relaxng.c: remove an unused intitialization
diff --git a/encoding.c b/encoding.c
index d48c757..b86a547 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1602,14 +1602,17 @@
}
upper[i] = 0;
- for (i = 0;i < nbCharEncodingHandler; i++)
- if (!strcmp(upper, handlers[i]->name)) {
+ if (handlers != NULL) {
+ for (i = 0;i < nbCharEncodingHandler; i++) {
+ if (!strcmp(upper, handlers[i]->name)) {
#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "Found registered handler for encoding %s\n", name);
+ xmlGenericError(xmlGenericErrorContext,
+ "Found registered handler for encoding %s\n", name);
#endif
- return(handlers[i]);
- }
+ return(handlers[i]);
+ }
+ }
+ }
#ifdef LIBXML_ICONV_ENABLED
/* check whether iconv can handle this */