mirror of https://github.com/ARMmbed/mbed-os.git
AT_CellularStack: crash during TCP test
function tries to access _socket[1] whch is not openedpull/12329/head
parent
706625a982
commit
a1fb286c06
|
@ -429,8 +429,10 @@ void AT_CellularStack::socket_attach(nsapi_socket_t handle, void (*callback)(voi
|
|||
int AT_CellularStack::get_socket_index_by_port(uint16_t port)
|
||||
{
|
||||
for (int i = 0; i < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT); i++) {
|
||||
if (_socket[i]->localAddress.get_port() == port) {
|
||||
return i;
|
||||
if (_socket[i] != 0) {
|
||||
if (_socket[i]->localAddress.get_port() == port) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue