UPSTREAM PR #27100: Guard against null stream_ in EpsCopyOutputStream::EnableAliasing#156
UPSTREAM PR #27100: Guard against null stream_ in EpsCopyOutputStream::EnableAliasing#156loci-dev wants to merge 1 commit into
Conversation
OverviewAnalysis of 10,164 functions (1 modified, 0 new, 0 removed, 10,163 unchanged) across Power Consumption:
Function Analysis
Commit cfb66d6 added null pointer check ( 💬 Questions? Tag @loci-dev |
f292971 to
1fdfb93
Compare
Note
Source pull request: protocolbuffers/protobuf#27100
Fix the issue described in protocolbuffers/protobuf#27099.
EpsCopyOutputStreamcan be constructed in "array-only" mode viaEpsCopyOutputStream(void*, int, bool), which intentionally setsstream_to nullptr (no backingZeroCopyOutputStream). CallingEnableAliasing()in this state unconditionally dereferencedstream_to call the virtualAllowsAliasing(), causing a null pointer dereference (UBSan: member call on null pointer) and immediate SIGSEGV.The fix adds a null check before the virtual dispatch. When
stream_is null,AllowsAliasing()is meaningless and the result correctly evaluates to false, leavingaliasing_enabled_unset.