Skip to content

Commit e6d24c3

Browse files
author
adustman
committed
Fix: Error is not checked if mysql_store_result returns NULL (#3546166)
1 parent 1007731 commit e6d24c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

MySQLdb/_mysql.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ _mysql_ResultObject_Initialize(
381381
self->result = result;
382382
Py_END_ALLOW_THREADS ;
383383
if (!result) {
384+
if (mysql_field_count(&(conn->connection)) > 0) {
385+
_mysql_Exception(conn);
386+
return -1;
387+
}
384388
self->converter = PyTuple_New(0);
385389
return 0;
386390
}

0 commit comments

Comments
 (0)