aboutsummaryrefslogtreecommitdiffstats
path: root/parserInternals.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-11-08 14:02:18 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-11-08 14:02:18 +0000
commit2a4fb5ac07c6eff494aec174041fa01a6a828230 (patch)
tree29c61bb78667c7236a11d5c6f959535018b586aa /parserInternals.c
parent5ea30d7f9523dfd6280251f0310b0fd75c461aa8 (diff)
downloadandroid_external_libxml2-2a4fb5ac07c6eff494aec174041fa01a6a828230.tar.gz
android_external_libxml2-2a4fb5ac07c6eff494aec174041fa01a6a828230.tar.bz2
android_external_libxml2-2a4fb5ac07c6eff494aec174041fa01a6a828230.zip
more coverage more fixes Daniel
* gentest.py testapi.c: more coverage * SAX2.c parser.c parserInternals.c: more fixes Daniel
Diffstat (limited to 'parserInternals.c')
-rw-r--r--parserInternals.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parserInternals.c b/parserInternals.c
index 026e6a18..ee41353c 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -390,6 +390,7 @@ xmlParserInputShrink(xmlParserInputPtr in) {
#ifdef DEBUG_INPUT
xmlGenericError(xmlGenericErrorContext, "Shrink\n");
#endif
+ if (in == NULL) return;
if (in->buf == NULL) return;
if (in->base == NULL) return;
if (in->cur == NULL) return;
@@ -446,7 +447,8 @@ xmlParserInputShrink(xmlParserInputPtr in) {
void
xmlNextChar(xmlParserCtxtPtr ctxt)
{
- if (ctxt->instate == XML_PARSER_EOF)
+ if ((ctxt == NULL) || (ctxt->instate == XML_PARSER_EOF) ||
+ (ctxt->input == NULL))
return;
if (ctxt->charset == XML_CHAR_ENCODING_UTF8) {
@@ -606,6 +608,7 @@ encoding_error:
int
xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
+ if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
if (ctxt->instate == XML_PARSER_EOF)
return(0);
@@ -746,6 +749,7 @@ encoding_error:
int
xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar * cur, int *len)
{
+ if ((len == NULL) || (cur == NULL)) return(0);
if ((ctxt == NULL) || (ctxt->charset == XML_CHAR_ENCODING_UTF8)) {
/*
* We are supposed to handle UTF8, check it's valid
@@ -842,6 +846,7 @@ encoding_error:
*/
int
xmlCopyCharMultiByte(xmlChar *out, int val) {
+ if (out == NULL) return(0);
/*
* We are supposed to handle UTF8, check it's valid
* From rfc2044: encoding of the Unicode values on UTF-8:
@@ -884,6 +889,7 @@ xmlCopyCharMultiByte(xmlChar *out, int val) {
int
xmlCopyChar(int len ATTRIBUTE_UNUSED, xmlChar *out, int val) {
+ if (out == NULL) return(0);
/* the len parameter is ignored */
if (val >= 0x80) {
return(xmlCopyCharMultiByte (out, val));