Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b2cf0e

Browse files
committed
Undo usage of PyOS_snprintf (rev. 1.51 of PyXML).
1 parent 550fd5d commit 6b2cf0e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/pyexpat.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ set_error(xmlparseobject *self)
113113
int column = XML_GetErrorColumnNumber(parser);
114114
enum XML_Error code = XML_GetErrorCode(parser);
115115

116-
PyOS_snprintf(buffer, sizeof(buffer), "%.200s: line %i, column %i",
116+
/* There is no risk of overflowing this buffer, since
117+
even for 64-bit integers, there is sufficient space. */
118+
sprintf(buffer, "%.200s: line %i, column %i",
117119
XML_ErrorString(code), lineno, column);
118120
err = PyObject_CallFunction(ErrorObject, "s", buffer);
119121
if ( err != NULL

0 commit comments

Comments
 (0)