Skip to content
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

[C++][Compute] Predicate IsAsciiCharacter allows invalid types and values #29436

Closed
asfimport opened this issue Aug 31, 2021 · 1 comment
Closed

Comments

@asfimport
Copy link

The IsAsciiCharacter predicate has a template type for its input parameter but it only checks if the value is less than 128. This check is unbounded in its lower bound, so it is prone to receive non-ASCII characters (negative value) and return true. There are three solutions in order of my preference:

  1. Remove the template and make the type uint8_t. All its use cases use uint8_t and this is the type used across the ASCII operations. Also, the other string-related utility functions are not templates.
  2. Constrain the template so that it only accepts unsigned integers.
  3. Add a check to validate that argument is non-negative. This check adds unnecessary overhead.

Reporter: Eduardo Ponce / @edponce
Assignee: Eduardo Ponce / @edponce

PRs and other links:

Note: This issue was originally created as ARROW-13810. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
Issue resolved by pull request 11048
#11048

@asfimport asfimport added this to the 6.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant