Message125974
| Author |
vstinner |
| Recipients |
amaury.forgeotdarc, brian.curtin, janglin, loewis, pitrou, schmir, vstinner |
| Date |
2011年01月11日.01:13:37 |
| SpamBayes Score |
0.00071597646 |
| Marked as misclassified |
No |
| Message-id |
<1294708423.05.0.406559786751.issue9566@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
... and issue9566.patch: various fixes. Interesting parts:
---
- id = PyLong_FromLong((Py_uintptr_t) self);
+ id = PyLong_FromVoidPtr(self);
---
---
LOCAL(PyObject*)
-expat_parse(XMLParserObject* self, char* data, int data_len, int final)
+expat_parse(XMLParserObject* self, char* data, Py_ssize_t data_len, int final)
{
int ok;
- ok = EXPAT(Parse)(self->parser, data, data_len, final);
+ if (data_len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "length doesn't fit in an int");
+ return NULL;
+ }
+
+ ok = EXPAT(Parse)(self->parser, data, (int)data_len, final);
---
---
- long hash = PyObject_Hash(arg);
+ Py_hash_t hash = PyObject_Hash(arg);
--- |
|