Closed adbridge closed 8 years ago
ARM Internal Ref: IOTSFW-1510
The documentation states that the socket must have been opened before the resolve is called. Other methods check for the 'impl' to be non NULL when checking if a socket is open. The implementation for this method instead checks if _socket.handler != NULL. This is inconsistent . The error reported by this check is SOCKET_ERROR_CLOSED, which is also inconsistent for a non opened socket. To be consistent with other methods the following code should be used :-
if (_socket.impl == NULL) {
return SOCKET_ERROR_NULL_PTR;
If the current check is actually for an additional error case then it should be kept and documented accordingly, with the addition of the above check.
5 General Any pointer dereferenced directly within the method implementation should be checked for being non-NULL before dereferencing. Any pointers passed down to the API do not need to be checked as it can be the responsibility of the API to do so.