-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Description
Basic Infos
- This issue complies with the issue POLICY doc.
- I have read the documentation at readthedocs and the issue is not addressed there.
- I have tested that the issue is present in current master branch (aka latest git).
- I have searched the issue tracker for a similar issue.
- If there is a stack dump, I have decoded it.
- I have filled out all fields below.
Problem Description
At libraries/Netdump.cpp packetBuffer is dereferenced without checking for nullptr.
packetBuffer is filled at Netdump::tcpDump, but it's with a new (std::nothrow) ... and Netdump::tcpDump is called anyway.
That means if new (std::nothrow) ... returns a null pointer because it's out of memory UB will happen.
I'm prepared to provide a PR to fix it, but I don't know the best way to do this. Should I just check at Netdump::tcpDumpProcess if packetBuffer is filled and return early? Is there a way to warn the user? And I'm not really sure what is the appropriate cleanup code, or if a return; is sufficient.
Metadata
Metadata
Assignees
Labels
No labels