mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
fix segfault on invalid vec_each() input, fixes #163
This commit is contained in:
parent
21eda5c24d
commit
44e4438ed5
2 changed files with 6 additions and 1 deletions
|
|
@ -2483,7 +2483,9 @@ static int vec_eachOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor) {
|
||||||
|
|
||||||
static int vec_eachClose(sqlite3_vtab_cursor *cur) {
|
static int vec_eachClose(sqlite3_vtab_cursor *cur) {
|
||||||
vec_each_cursor *pCur = (vec_each_cursor *)cur;
|
vec_each_cursor *pCur = (vec_each_cursor *)cur;
|
||||||
|
if(pCur->vector) {
|
||||||
pCur->cleanup(pCur->vector);
|
pCur->cleanup(pCur->vector);
|
||||||
|
}
|
||||||
sqlite3_free(pCur);
|
sqlite3_free(pCur);
|
||||||
return SQLITE_OK;
|
return SQLITE_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1614,6 +1614,9 @@ def test_vec_each():
|
||||||
{"rowid": 2, "value": 3.0},
|
{"rowid": 2, "value": 3.0},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
with _raises("Input must have type BLOB (compact format) or TEXT (JSON), found NULL"):
|
||||||
|
vec_each_f32(None)
|
||||||
|
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue