From f87ed4c84bb51fd5054536436795b80b596661de Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sat, 16 Apr 2022 14:30:49 +0900 Subject: [PATCH] Fix out of range bug --- MySQLdb/_mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index f10cd015..2c02d765 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -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; }