Skip to content

Crash when reading table with rowid as column name #80

@manisandro

Description

@manisandro

Create a table with

CREATE TABLE "test"(rowid INTEGER PRIMARY KEY)

Attempting to open the corresponding sqlite file will result in

line 1:47: unexpected token: rowid

and the program segfaulting:

#0  0x0000000000495b1b in sqlb::CreateTableWalker::table() (this=this@entry=0x7fffffffcc50)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/sqlitetypes.cpp:300
#1  0x0000000000496c1e in sqlb::Table::parseSQL(QString const&) (sSQL=...)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/sqlitetypes.cpp:144
#2  0x00000000004848be in DBBrowserDB::updateSchema() (this=this@entry=0x838c70)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/sqlitedb.cpp:811
#3  0x000000000044ff59 in MainWindow::populateStructure() (this=this@entry=0x838b60)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/MainWindow.cpp:228
#4  0x000000000045d286 in MainWindow::fileOpen(QString const&) (this=0x838b60, fileName=...)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/MainWindow.cpp:194
#5  0x00000000004da9ec in Application::Application(int&, char**) (this=0x7fffffffdc60, argc=<optimized out>, argv=0x7fffffffdd88)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/Application.cpp:77
#6  0x000000000043383b in main(int, char**) (argc=2, argv=<optimized out>)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/main.cpp:6

#0  0x0000000000495b1b in sqlb::CreateTableWalker::table() (this=this@entry=0x7fffffffcc50)
    at /usr/src/debug/sqlitebrowser-sqlb-3.2.0/src/sqlitetypes.cpp:300
        tc = {ref = 0x0}
[...]

Sample sqlite file: https://smani.fedorapeople.org/tmp/test.sqlite

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions