Fix out of range bug (#538)

This commit is contained in:
Inada Naoki
2022-04-17 10:21:21 +09:00
committed by GitHub
parent 9729618950
commit c1c812a1df

View File

@ -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;
}