SQLite

View Ticket
Login
Ticket Hash: 8f81455baf1099c16b0da49c1e9c6c735e2e94e3
Title: fts3GetVarint32 sets random number on error
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Extensions Resolution: Not_A_Bug
Last Modified: 2014-03-11 12:49:29
Version Found In: 3.6.21
Description:
Original at http://www.sqlite.org/cvstrac/tktview?tn=4035

fts3GetVarint32 has a 64 bit local variable that is uninitialized and then passed by address to fts3GetVarint. (Some compilers whine about this.) If fts3GetVarint has an error it does not fill in the variable but fts3GetVarint32 does with the random stack value.

Looking through the rest of the code it is extraordinarily rare for an error return of fts3GetVarint(32) to be looked for.

fts3GetVarint32 should not fill in value on getting zero from fts3GetVarint. Or both routines could be made consistent and set pointed to value to zero on error.


anonymous added on 2009-12-10 17:09:21:
In addition fts3GetDeltaVarint also calls sqlite3fts3GetVarint, with same issue/potential bug.