diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-04-01 09:55:20 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-04-01 09:55:20 +0000 |
commit | e502041f5b44b9f88f3acce90dd6bc4afd85bb54 (patch) | |
tree | 31abe9d8a44ca362582ab2892dbac49ac59108fc /SAX.c | |
parent | 7fe1f3a502e6418b8ea26194444243648ae73c96 (diff) | |
download | libxml2-e502041f5b44b9f88f3acce90dd6bc4afd85bb54.tar.gz |
fixed an uninitialized memory access pointed by valgrind on C14Ntests
* SAX.c: fixed an uninitialized memory access pointed by valgrind
on C14Ntests
Daniel
Diffstat (limited to 'SAX.c')
-rw-r--r-- | SAX.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |