Commit 562ced52 authored by Marc Durdin's avatar Marc Durdin
Browse files

fix(developer): GetDelimitedString was using wrong strchr

Picked this up while running `-fsanitize=address` for trying to track
down another bug.

This fixes a buffer overrun (normally invisible) in kmcmplib, where
`xstrchr` was being called, which takes a string as its second
parameter, but being passed a single character. This was incorrect
behaviour for two reasons:

1. Passing a single character doesn't have null termination (big bug!)
2. We were not wanting xstring semantics on the token being parsed here

Replaced with `u16chr`, which does do what we want. Note the
casting because `u16chr` only has a `const` version of its input/output
at present.

Removed `xstrchr` because it is not used anywhere else in kmcmplib.
parent 3b735cdc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment