Issue #19437: Fix pysqlite_cursor_iternext() of sqlite3, handle

_pysqlite_fetch_one_row() failure
This commit is contained in:
Victor Stinner 2013-11-05 14:30:11 +01:00
parent 607981402c
commit dd4b299df1
1 changed files with 6 additions and 0 deletions

View File

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