Handling Non-Null-Terminated Strings in fts5TriTokenize: Buffer Overread Risks and Fixes
Understanding the fts5TriTokenize Buffer Overread Vulnerability The Core Problem: UTF-8 Parsing and Input Boundary Checks The fts5TriTokenize function, part of SQLite’s Full-Text Search (FTS5) module, is designed to generate trigram tokens from input text for indexing and querying. A critical issue arises when this function processes input strings that are not null-terminated, particularly those with…