mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
replaced sprintf() with snprintf() to prevent possible buffer overflow
* DOCBparser.c HTMLparser.c debugXML.c encoding.c nanoftp.c nanohttp.c parser.c tree.c uri.c xmlIO.c xmllint.c xpath.c: replaced sprintf() with snprintf() to prevent possible buffer overflow (the bug was pointed out by Anju Premachandran)
This commit is contained in:
4
parser.c
4
parser.c
@ -5348,9 +5348,9 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
||||
ctxt->sax->characters(ctxt->userData, out, 1);
|
||||
} else {
|
||||
if ((hex == 'x') || (hex == 'X'))
|
||||
sprintf((char *)out, "#x%X", value);
|
||||
snprintf((char *)out, sizeof(out), "#x%X", value);
|
||||
else
|
||||
sprintf((char *)out, "#%d", value);
|
||||
snprintf((char *)out, sizeof(out), "#%d", value);
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
|
||||
(!ctxt->disableSAX))
|
||||
ctxt->sax->reference(ctxt->userData, out);
|
||||
|
Reference in New Issue
Block a user