Open
Description
Description of defect
There are several netsocket
source files that dynamically allocate without std::nothrow
or otherwise checking for allocation failure. Here is the list of files, excluding tests:
- NetworkInterface.cpp: 148
- nsapi_dns.cpp: 985
- TCPSocket.cpp 269
- TLSSocketWrapper.cpp: 137, 289, 430, 462, 572
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.