Skip to content

Commit

Permalink
Fix out of range bug (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Apr 17, 2022
1 parent 9729618 commit c1c812a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MySQLdb/_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ _mysql_ResultObject_fetch_row(
&maxrows, &how))
return NULL;
check_result_connection(self);
if (how >= (int)sizeof(row_converters)) {
if (how >= (int)(sizeof(row_converters) / sizeof(row_converters[0]))) {
PyErr_SetString(PyExc_ValueError, "how out of range");
return NULL;
}
Expand Down

0 comments on commit c1c812a

Please sign in to comment.