fixed an uninitialized memory access pointed by valgrind on C14Ntests

* SAX.c: fixed an uninitialized memory access pointed by valgrind
  on C14Ntests
Daniel
This commit is contained in:
Daniel Veillard 2003-04-01 09:55:20 +00:00
parent 7fe1f3a502
commit e502041f5b
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Tue Apr 1 11:52:15 CEST 2003 Daniel Veillard <daniel@veillard.com>
* SAX.c: fixed an uninitialized memory access pointed by valgrind
on C14Ntests
Tue Apr 1 00:12:28 CEST 2003 Daniel Veillard <daniel@veillard.com>
* relaxng.c: one more fixup of error message reporting

6
SAX.c
View File

@ -247,8 +247,10 @@ externalSubset(void *ctx, const xmlChar *name,
/*
* On the fly encoding conversion if needed
*/
enc = xmlDetectCharEncoding(ctxt->input->cur, 4);
xmlSwitchEncoding(ctxt, enc);
if (ctxt->input->length >= 4) {
enc = xmlDetectCharEncoding(ctxt->input->cur, 4);
xmlSwitchEncoding(ctxt, enc);
}
if (input->filename == NULL)
input->filename = (char *) xmlStrdup(SystemID);