-
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
Fix 'netsocket: several dynamic allocation results not checked' (#14210) #14706
Fix 'netsocket: several dynamic allocation results not checked' (#14210) #14706
Conversation
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
@chrisswinchatt-arm, thank you for your changes. |
Pull request type can be set to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have missed that one but why targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TOOLCHAIN_GCC_ARM/stm32f401xe.ld
is deleted ?
@pan- |
#14601 |
@JojoS62 How can I reproduce , can you report as new issue. We should look at it if there is an issue with the file |
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please start CI to get the PR merged. |
@chrisswinchatt-arm can you take a look at #14661 and the issue that spawned it #14601 ? I'm wondering if you had an out of date mbed-os which caused the problems. It might be safer to rebase your changes needed for this PR on top of the latest mbed-os just to make sure ? |
This is still affecting the API so while not Major it should be Feature. I will update it. |
Please rebase instead of merging (the git history should be linear here without merge commits) |
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
Incorporates PR #14223 + changes required for spellchecker
Re-forked and moved to #14740. |
Summary of changes
(Copied from #14223)
This changes adds
std::nowthrow
and the checks for allocation failure to all places in thenetsocket
portion that lacked it. This change addresses #14210.Impact of changes
add_event_listener
inNetworkInterface
now returns an error if the method fails. Previous attempts to add the event listener would attempt to use an unchecked standard dynamically allocatedns_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 allocatednew 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 theTCPSocket
is listening.Migration actions required
As
new
calls are now handled, code that did not check against this failure may now check for failure and handle it at the application layer.add_event_listener
now returnsnsapi_error_t
instead ofvoid
. The two return values possible areNSAPI_ERROR_OK
andNSAPI_ERROR_NO_MEMORY
in the case of memory allocation failure.Documentation
NetworkInterface.h
now has changes to theadd_event_listener
method. This method will now returnnsapi_error_t
instead ofvoid
. The docstring for the interface has been updated.Pull request type
Test results
Reviewers