Skip to content

Commit 74546ed

Browse files
committed
Fix heap-buffer-overflow in Swift tree-sitter scanner
The Swift external scanner called calloc(0, sizeof(ScannerState)) which returns a 0-or-1-byte allocation per the C standard. The scanner then writes a uint32_t (4 bytes) to this region via state->ongoing_raw_str_hash_count, causing a heap-buffer-overflow detected by AddressSanitizer. Fix: calloc(0, ...) → calloc(1, ...).
1 parent 4fe90ca commit 74546ed

File tree

1 file changed

+1
-1
lines changed
  • internal/cbm/vendored/grammars/swift

1 file changed

+1
-1
lines changed

internal/cbm/vendored/grammars/swift/scanner.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)