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++] Do not return buffers containing nullptr from internal allocations #20736
Comments
Antoine Pitrou / @pitrou:
|
Antoine Pitrou / @pitrou: |
Wes McKinney / @wesm: |
Antoine Pitrou / @pitrou: |
Ben Kietzman / @bkietz: |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
When a 0-byte buffer is allocated, or at the start of a BufferBuilder, the buffer's data pointer can be null. This leads to passing null arguments (with zero sizes) to standard functions such as memset() and memcpy() in many places. UBSAN doesn't like it.
Since a null pointer often means "failed allocating" or "programmer error", we might want to use a non-null pointer to a static empty piece of data instead.
Reporter: Antoine Pitrou / @pitrou
Assignee: Antoine Pitrou / @pitrou
PRs and other links:
Note: This issue was originally created as ARROW-4150. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: