File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1283,14 +1283,19 @@ static PyObject *read_row_from_packet(
12831283 case MYSQL_TYPE_LONG :
12841284 case MYSQL_TYPE_LONGLONG :
12851285 case MYSQL_TYPE_INT24 :
1286+ {
1287+ char * substr = calloc (out_l + 1 , sizeof (char ));
1288+ memcpy (substr , out , out_l );
12861289 if (py_state -> flags [i ] & MYSQL_FLAG_UNSIGNED ) {
1287- py_item = PyLong_FromUnsignedLongLong (strtoull (out , & end , 10 ));
1290+ py_item = PyLong_FromUnsignedLongLong (strtoull (substr , NULL , 10 ));
12881291 } else {
1289- py_item = PyLong_FromLongLong (strtoll (out , & end , 10 ));
1292+ py_item = PyLong_FromLongLong (strtoll (substr , NULL , 10 ));
12901293 }
1294+ DESTROY (substr );
1295+ out += out_l ;
12911296 if (!py_item ) goto error ;
12921297 break ;
1293-
1298+ }
12941299 case MYSQL_TYPE_FLOAT :
12951300 case MYSQL_TYPE_DOUBLE :
12961301 py_item = PyFloat_FromDouble (strtod (out , & end ));
You can’t perform that action at this time.
0 commit comments