@@ -106,7 +106,7 @@ RS_XML(treeApply)(USER_OBJECT_ rtree, USER_OBJECT_ function, USER_OBJECT_ args)
106106
107107#include <stdarg.h>
108108
109- void localXmlParserPrintFileInfo (xmlParserInputPtr input , char * buf );
109+ void localXmlParserPrintFileInfo (xmlParserInputPtr input , char * buf , int nbuf );
110110
111111
112112#ifndef USE_LINKED_ERROR_HANDLER
@@ -128,7 +128,7 @@ void xmlParserError(void *ctx, const char *msg, ...)
128128 memset (buf , '\0' , sizeof (buf )/sizeof (buf [0 ]));
129129
130130 /* Insert the file and line number. */
131- localXmlParserPrintFileInfo (ctxt -> input , buf );
131+ localXmlParserPrintFileInfo (ctxt -> input , buf , 3000 );
132132 /* Move to the end of the buffer's contents. */
133133 tmp = buf + strlen (buf );
134134
@@ -169,13 +169,13 @@ RSXML_setErrorHandlers(void)
169169 Write the file name and the current line number into the specified
170170 string.
171171 */
172- void localXmlParserPrintFileInfo (xmlParserInputPtr input , char * buf ) {
172+ void localXmlParserPrintFileInfo (xmlParserInputPtr input , char * buf , int nbuf ) {
173173 if (input != NULL ) {
174174 if (input -> filename )
175- sprintf (buf , "%s:%d: " , input -> filename ,
175+ snprintf (buf , nbuf , "%s:%d: " , input -> filename ,
176176 input -> line );
177177 else
178- sprintf (buf , "Entity: line %d: " , input -> line );
178+ snprintf (buf , nbuf , "Entity: line %d: " , input -> line );
179179 }
180180}
181181
0 commit comments