summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-30 20:51:40 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-30 20:51:40 (GMT)
commitdafd32b730c246b76a28e4089253e3a2b614df58 (patch)
tree740fe6b260b2daa3de96b66140941337954d5bf3 /Python
parentbe49a90eb3c54bd29a8bf3da5875db26d2fa2924 (diff)
downloadcpython-dafd32b730c246b76a28e4089253e3a2b614df58.zip
cpython-dafd32b730c246b76a28e4089253e3a2b614df58.tar.gz
cpython-dafd32b730c246b76a28e4089253e3a2b614df58.tar.bz2
Issue #1521: on 64bit platforms, str.decode fails on very long strings.
The t# and w# formats were not correctly handled. Will backport.
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index a848116..2cae516 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -894,7 +894,8 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
char **buffer;
const char *encoding;
PyObject *s;
- int size, recode_strings;
+ Py_ssize_t size;
+ int recode_strings;
/* Get 'e' parameter: the encoding name */
encoding = (const char *)va_arg(*p_va, const char *);
@@ -1144,7 +1145,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
case 'w': { /* memory buffer, read-write access */
void **p = va_arg(*p_va, void **);
PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
- int count;
+ Py_ssize_t count;
if (pb == NULL ||
pb->bf_getwritebuffer == NULL ||
@@ -1166,7 +1167,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
case 't': { /* 8-bit character buffer, read-only access */
char **p = va_arg(*p_va, char **);
PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
- int count;
+ Py_ssize_t count;
if (*format++ != '#')
return converterr(