mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 00:36:56 +02:00
Fix bad-free in ensure_vector_match: aCleanup(a) → aCleanup(*a)
When the second vector argument fails to parse, the cleanup of the first vector was called with the double-pointer 'a' instead of '*a'. When the first vector was parsed from JSON text (cleanup = sqlite3_free), this called sqlite3_free on a stack address, causing a crash. Found by the vec-mismatch fuzz target. Shout out to @renatgalimov in #257 for finding the original bug! Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0dd0765cc6
commit
4ce1ef3c6f
1 changed files with 1 additions and 1 deletions
|
|
@ -1028,7 +1028,7 @@ int ensure_vector_match(sqlite3_value *aValue, sqlite3_value *bValue, void **a,
|
|||
if (rc != SQLITE_OK) {
|
||||
*outError = sqlite3_mprintf("Error reading 2nd vector: %s", error);
|
||||
sqlite3_free(error);
|
||||
aCleanup(a);
|
||||
aCleanup(*a);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue