mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-11 05:04:22 +01:00
* fix: reject non-numeric file stats before SQLite bind in external ingest index Virtual/custom file system providers can return a FileStat whose `size` or `mtime` is not a number, violating the declared `number` type of safeStat(). These values were passed straight into a node:sqlite parameter bind, which rejects any non-number value and throws the unhandled error "Provided value cannot be bound to SQLite parameter 2". Validate the numeric contract at the file-system boundary in safeStat() and treat a stat with a non-numeric size or mtime as unusable (return undefined), matching the function's existing behaviour for directories and stat failures. Fixes #321794 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: reject non-finite external ingest file stats Use finite-number validation at the filesystem boundary so NaN and infinity cannot reach SQLite. Cover malformed provider metadata while ensuring later valid files are still indexed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>