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

object is null in class AbstractOMNeTARAClient #121

Open
mfrey opened this issue Jul 31, 2014 · 1 comment
Open

object is null in class AbstractOMNeTARAClient #121

mfrey opened this issue Jul 31, 2014 · 1 comment
Assignees

Comments

@mfrey
Copy link
Member

mfrey commented Jul 31, 2014

A bug reported by the clang static analyzer.

Description: Called C++ object pointer is null
File: AbstractOMNeTARAClient.cpp
Lines: 100, 200, and 206

omnetpp/AbstractOMNeTARAClient.cpp:100:26: warning: Called C++ object pointer is null
    int nrOfInterfaces = interfaceTable->getNumInterfaces();
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
omnetpp/AbstractOMNeTARAClient.cpp:200:37: warning: Called C++ object pointer is null
        cPacket* encapsulatedData = simPacket->decapsulate();
                                    ^~~~~~~~~~~~~~~~~~~~~~~~
omnetpp/AbstractOMNeTARAClient.cpp:206:9: warning: Called C++ object pointer is null
        encapsulatedData->setControlInfo(controlInfo);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
@mfrey mfrey added bug labels Jul 31, 2014
@mfrey
Copy link
Member Author

mfrey commented Jul 31, 2014

The issue in line 200 and 206 refer to a (maybe) failing dynamic_cast. Hence, added a check. The same goes for the issue in line 100. The interfaceTable might not be initialized. However, the assert should avoid that subsequent calls are made. For the sake of clarity and for the static analyzer, I've added a check on the pointer.

@mfrey mfrey self-assigned this Oct 16, 2014
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