From: Victor Stinner Date: Tue, 5 Nov 2013 13:30:11 +0000 (+0100) Subject: Issue #19437: Fix pysqlite_cursor_iternext() of sqlite3, handle X-Git-Tag: v3.4.0b1~388 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd4b299df1589dea63f4067b5617869d7baa7e23;p=thirdparty%2FPython%2Fcpython.git Issue #19437: Fix pysqlite_cursor_iternext() of sqlite3, handle _pysqlite_fetch_one_row() failure --- diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index bf4bbb4a2857..cf7f9d324288 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -891,6 +891,12 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self) if (rc == SQLITE_ROW) { self->next_row = _pysqlite_fetch_one_row(self); + if (self->next_row == NULL) { + (void)pysqlite_statement_reset(self->statement); + Py_DECREF(next_row); + _pysqlite_seterror(self->connection->db, NULL); + return NULL; + } } }