apache / apache/arrow

Potential dereference of nullptr

Open
#49,445 5 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

In the function https://github.com/apache/arrow/blob/d42c7ddcc233b8f372dfd7b74f51953517e16605/cpp/src/arrow/c/bridge.cc#L2615
The pointer self->producer was unsafely dereferenced after NULL check
https://github.com/apache/arrow/blob/d42c7ddcc233b8f372dfd7b74f51953517e16605/cpp/src/arrow/c/bridge.cc#L2618
https://github.com/apache/arrow/blob/d42c7ddcc233b8f372dfd7b74f51953517e16605/cpp/src/arrow/c/bridge.cc#L2632
It is likely that the check is not necessary but it could be a cause of a segmentation fault.

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.