rrdtool/rrdtool-1.2.23-ssize.diff

17 lines
457 B
Diff

--- bindings/python/rrdtoolmodule.c
+++ bindings/python/rrdtoolmodule.c
@@ -57,7 +57,12 @@
PyObject *o;
int size, i;
- size = PyTuple_Size(args);
+ if ( PyTuple_Size(args) <= INT_MAX )
+ size = PyTuple_Size(args);
+ else {
+ PyErr_Format(PyExc_ValueError,"too big return value");
+ return -1;
+ }
*argv = PyMem_New(char *, size + 1);
if (*argv == NULL)
return -1;