websql: Fix racy SQLite API usage in SQLiteStatement.
SQLiteStatement::GetColumn value currently uses sqlite3_column_value() to retrieve a sqlite3_value*, and then uses other API calls to extract information from the value. The SQLite documentation [1, 2] states that sqlite3_column_value() returns an "unprotected value", which should not be operated on directly. When SQLite is compiled with multi-threading support (as Chrome does), the incorrect usage triggers assets in SQLite. This CL replaces the incorrect usage of sqlite3_value* with SQLite API calls documented in [2] which are safe to use, inspired from sql::Statement. [1] https://www.sqlite.org/c3ref/value.html [2] https://www.sqlite.org/c3ref/column_blob.html Bug: 906396 Change-Id: Ic8f7caac31c5be91113af576c020236aeb4106dc Reviewed-on: https://chromium-review.googlesource.com/c/1343574 Commit-Queue: Victor Costan <pwnall@chromium.org> Reviewed-by:Joshua Bell <jsbell@chromium.org> Cr-Commit-Position: refs/heads/master@{#609748}
Showing
Please register or sign in to comment