@@ -1838,6 +1838,7 @@ static PyObject *cxoCursor_var(cxoCursor *cursor, PyObject *args,
1838
1838
PyObject * inConverter , * outConverter , * typeNameObj ;
1839
1839
cxoTransformNum transformNum ;
1840
1840
const char * encodingErrors ;
1841
+ Py_ssize_t encodingErrorsLen ;
1841
1842
cxoObjectType * objType ;
1842
1843
int size , arraySize ;
1843
1844
PyObject * type ;
@@ -1848,9 +1849,9 @@ static PyObject *cxoCursor_var(cxoCursor *cursor, PyObject *args,
1848
1849
encodingErrors = NULL ;
1849
1850
arraySize = cursor -> bindArraySize ;
1850
1851
inConverter = outConverter = typeNameObj = NULL ;
1851
- if (!PyArg_ParseTupleAndKeywords (args , keywordArgs , "O|iiOOOz" ,
1852
+ if (!PyArg_ParseTupleAndKeywords (args , keywordArgs , "O|iiOOOz# " ,
1852
1853
keywordList , & type , & size , & arraySize , & inConverter , & outConverter ,
1853
- & typeNameObj , & encodingErrors ))
1854
+ & typeNameObj , & encodingErrors , & encodingErrorsLen ))
1854
1855
return NULL ;
1855
1856
1856
1857
// determine the type of variable
@@ -1875,7 +1876,7 @@ static PyObject *cxoCursor_var(cxoCursor *cursor, PyObject *args,
1875
1876
1876
1877
// assign encoding errors, if applicable
1877
1878
if (encodingErrors ) {
1878
- var -> encodingErrors = PyMem_Malloc (strlen ( encodingErrors ) + 1 );
1879
+ var -> encodingErrors = PyMem_Malloc (encodingErrorsLen + 1 );
1879
1880
if (!var -> encodingErrors ) {
1880
1881
Py_DECREF (var );
1881
1882
return NULL ;
0 commit comments