summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-05 13:30:11 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-05 13:30:11 (GMT)
commitdd4b299df1589dea63f4067b5617869d7baa7e23 (patch)
treedd90891f347974674eb591eacc871eecb20d5366 /Modules/_sqlite
parent607981402cba9dc783eb8a934d9814c77b824c6b (diff)
downloadcpython-dd4b299df1589dea63f4067b5617869d7baa7e23.zip
cpython-dd4b299df1589dea63f4067b5617869d7baa7e23.tar.gz
cpython-dd4b299df1589dea63f4067b5617869d7baa7e23.tar.bz2
Issue #19437: Fix pysqlite_cursor_iternext() of sqlite3, handle
_pysqlite_fetch_one_row() failure
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/cursor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index bf4bbb4..cf7f9d3 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;
+ }
}
}