Skip to content

Fix past end array access on unsigned char builds #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

txemaotero
Copy link

  • There are some platforms where char is implemented as unsigned char such as arm architectures. In these systems, the existing code to access the ParseFlagMap and WhitespaceMap arrays will access elements past the end of the arrays.
  • This PR fixes the bug by making the offset to convert the char into an array index dependent on how char is implemented.
  • Modifications on single headers were manually introduced as the command: cmake --build build/ --target=generate_single_header Introduces way more changes than the introduced ones.

Fix: #222
This PR provides an alternative approach that the solution presented in #247

- There are some platforms where `char` is implemented as `unsigned
  char` such as arm architectures. In this systems, the existing code
  to access the `ParseFlagMap` and `WhitespaceMap` arrays will access
  elements past the end of the arrays.
- This PR fixes the bug by making the offset to convert the `char` into
  an array index dependent on how `char` is implemented.
- Modifications on single headers were manually introduced as the
  command:
  `cmake --build build/ --target=generate_single_header`
  Introduces way more changes than the introduced ones.
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.

Problem to get header content!
1 participant