Kaydet (Commit) 7e3d961f authored tarafından Tim Peters's avatar Tim Peters

PyUnicode_EncodeUTF8: squash compiler wng. The difference of two

pointers is a signed type.  Changing "allocated" to a signed int makes
undetected overflow more likely, but there was no overflow detection
before either.
üst dc374e03
......@@ -1172,13 +1172,14 @@ int utf8_encoding_error(const Py_UNICODE **source,
}
#endif
PyObject *PyUnicode_EncodeUTF8(const Py_UNICODE *s,
int size,
const char *errors)
PyObject *
PyUnicode_EncodeUTF8(const Py_UNICODE *s,
int size,
const char *errors)
{
PyObject *v;
char *p;
unsigned int allocated = 0;
int allocated = 0;
int i;
/* Short-cut for emtpy strings */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment