From b491cacc9d66f329906556ebc7e1f4c5eae91e04 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Fri, 5 May 2023 16:44:03 -0400 Subject: [PATCH] Handle SQLITE_MISUSE This is an edge case, but results in a serious problem with this library. This is not ideal, but only happens if invalid input is fed to this library. Hopefully upstream will fix the code. --- sqlite3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite3.go b/sqlite3.go index 00bf7784..1f07864c 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -2188,7 +2188,7 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error { // nextSyncLocked moves cursor to next; must be called with locked mutex. func (rc *SQLiteRows) nextSyncLocked(dest []driver.Value) error { rv := C._sqlite3_step_internal(rc.s.s) - if rv == C.SQLITE_DONE { + if rv == C.SQLITE_DONE || rv == C.SQLITE_MISUSE { return io.EOF } if rv != C.SQLITE_ROW {