-
Notifications
You must be signed in to change notification settings - Fork 3k
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
netsocket: several dynamic allocation results not checked #14210
Comments
I first noticed this while trying to figure out if it would be possible inherit I realized that the |
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. |
…bed#14210) Incorporates PR ARMmbed#14223 + changes required for spellchecker
…bed#14210) Incorporates PR ARMmbed#14223 + changes required for spellchecker
Fix 'netsocket: several dynamic allocation results not checked' (#14210) add_event_listener in NetworkInterface now returns an error if the method fails. Previous attempts to add the event listener would attempt to use an unchecked standard dynamically allocated ns_list_* item. In other cases, the dynamically allocated items will now be checked, and if unsuccessful, will return after cleaning up any outstanding issues. TCPSocket::accept will now check that its own internally allocated new TCPSocket call will succeed, and if not, will clean up the stack resources. This should help when memory is low but an incoming connection requests a connection when the TCPSocket is listening.
Description of defect
There are several
netsocket
source files that dynamically allocate withoutstd::nothrow
or otherwise checking for allocation failure. Here is the list of files, excluding tests:Target(s) affected by this defect ?
All with onboard networking
Toolchain(s) (name and version) displaying this defect ?
N/A
What version of Mbed-os are you using (tag or sha) ?
mbed-os-6.7.0
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
N/A
How is this defect reproduced ?
Any allocation failure should result in crashing either in allocation failure or attempting to use an unallocated resource. For the most part, the failure should be handled and returned as an error instead.
The text was updated successfully, but these errors were encountered: