Skip to content

Commit c7fac2b

Browse files
committed
libsql-ffi: Update bundled SQLite
1 parent 9bd7387 commit c7fac2b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

libsql-ffi/bundled/src/sqlite3.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65356,18 +65356,25 @@ SQLITE_PRIVATE int sqlite3PagerWalInsert(Pager *pPager, unsigned int iFrame, voi
6535665356
}
6535765357
if (iFrame <= mxFrame) {
6535865358
unsigned long frame_len = nBuf-24;
65359-
unsigned char current[frame_len];
65359+
unsigned char *current;
65360+
65361+
current = (unsigned char *)sqlite3MallocZero(frame_len);
65362+
if (current == NULL) {
65363+
return SQLITE_NOMEM;
65364+
}
6536065365
rc = pPager->wal->methods.xReadFrame(pPager->wal->pData, iFrame, frame_len, current);
6536165366
if (rc != SQLITE_OK) {
65367+
sqlite3_free(current);
6536265368
return rc;
6536365369
}
6536465370
int conflict = 0;
65365-
if (memcmp(pBuf+24, current, frame_len) != 0) {
65371+
if (memcmp((unsigned char*)pBuf+24, current, frame_len) != 0) {
6536665372
conflict = 1;
6536765373
}
6536865374
if (pConflict) {
6536965375
*pConflict = conflict;
6537065376
}
65377+
sqlite3_free(current);
6537165378
if (conflict) {
6537265379
return SQLITE_ERROR;
6537365380
}

0 commit comments

Comments
 (0)