Bug 1810791 - Check SQLITE_IOERR_SHORT_READ against rc. r=dom-storage-reviewers,asuth,hsingh

Differential Revision: https://phabricator.services.mozilla.com/D167051
This commit is contained in:
Jan Rio Krause 2023-01-18 18:28:03 +00:00
parent 0f75bd2e66
commit f4ab16d8c2

View file

@ -313,7 +313,7 @@ static int obfsRead(sqlite3_file* pFile, void* zBuf, int iAmt,
if (iAmt == OBFS_PGSZ && !p->inCkpt) {
obfsDecode(p, (u8*)zBuf, iAmt);
}
} else if (SQLITE_IOERR_SHORT_READ && iOfst == 0 && iAmt >= 100) {
} else if (rc == SQLITE_IOERR_SHORT_READ && iOfst == 0 && iAmt >= 100) {
static const unsigned char aEmptyDb[] = {
0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66,
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00,