antlr / antlr/antlr3

[C++] Undefined behaviour in exception handling

Open
#191 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
253
Forks
178
PR merge metrics
No merged PRs in 30d

Description

There is a potential null pointer dereference here: https://github.com/antlr/antlr3/blob/master/runtime/Cpp/include/antlr3exception.inl#L315

m_expectingSet is very often null. It should be checked before doing anything with this pointer.

Currently it leads to undefined behaviour and sometimes crashes of the whole program.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open runtime/Cpp/include/antlr3exception.inl at line 315 and inspect how m_expectingSet is used during exception handling. Confirm when the pointer is null and verify that the handling path no longer dereferences it or produces undefined behavior; the issue provides no test file, so identify an appropriate runtime regression test if the repository has one.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.