I have discovered three potential bugs in sqlite which I think are
The first one is:
when I run the following command and immediately CTRL-C on it in a
shell, I get:
$ sqlite3 -cmd ".trace TRACE" db.sqlite -Ac /usr ; echo $?
ERROR: no such savepoint: ar
I would have expected a non-zero exitcode but I got a zero exitcode.
Apart from that, it outputs that no such savepoint was found, which is
When we look at the TRACE file we see:
DROP TABLE IF EXISTS sqlar;
CREATE TABLE IF NOT EXISTS sqlar(
name TEXT PRIMARY KEY, -- name of the file
mode INT, -- access permissions
mtime INT, -- last modification time
sz INT, -- original file size
data BLOB -- compressed content
REPLACE INTO sqlar(name,mode,mtime,sz,data)
ROLLBACK TO ar;
We see that the savepoint "ar" was created in the second line, but the
rollback to it in the last line failed.
I have replayed this trace ( with some hardcoded insert-data ) and
everything works fine ( exitcode and creation and restoration of the
savepoint). Therefore I think the problem must lie either in the
shellcode or in the archive-module.