Skip to content

Conversation

ddkilzer
Copy link

https://issues.oss-fuzz.com/issues/42498297

Found by oss-fuzz.

Fixes potential out-of-bounds write in both NormalizeSpaces() and DowngradeTypography(). Adds assert() statements to catch more bugs with fuzzing.

  • src/clean.c: (NormalizeSpaces):
    (DowngradeTypography):
  • Use a temporary buffer when calling PutUTF8() to avoid a heap buffer overflow write and to avoid clobbering data in-place.
  • Handle all possible return values after calling PutUTF8().
  • src/utf8.c: (DecodeUTF8BytesToChar):
    (GetUTF8):
    (PutUTF8):
  • Add assert() statements to catch bugs during fuzzing.

…F8Bytes

<https://issues.oss-fuzz.com/issues/42498297>

Found by oss-fuzz.

Fixes potential out-of-bounds write in both NormalizeSpaces() and
DowngradeTypography(). Adds assert() statements to catch more bugs with
fuzzing.

* src/clean.c:
(NormalizeSpaces):
(DowngradeTypography):
- Use a temporary buffer when calling PutUTF8() to avoid a heap buffer
  overflow write and to avoid clobbering data in-place.
- Handle all possible return values after calling PutUTF8().
* src/utf8.c:
(DecodeUTF8BytesToChar):
(GetUTF8):
(PutUTF8):
- Add assert() statements to catch bugs during fuzzing.
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