Skip to content

fix: prevent tokenizer heap overrun on long Thai input - #6

Merged
zdk merged 1 commit into
masterfrom
fix/tokenizer-pos-array-overrun
May 5, 2026
Merged

fix: prevent tokenizer heap overrun on long Thai input#6
zdk merged 1 commit into
masterfrom
fix/tokenizer-pos-array-overrun

Conversation

@zdk

@zdk zdk commented May 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

- size pos[] by buf_len, not buf_len/sizeof(wchar_t) (under-sized ~4x)
- handle num==0 single-word run without reading uninitialised pos[0]
- add asan_repro.c to walk a Thai sentence and flag invalid UTF-8 tokens
@zdk zdk self-assigned this May 5, 2026
@zdk
zdk merged commit 066b01e into master May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant