File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ const char *PPPInterface::get_ip_address()
94
94
95
95
nsapi_error_t PPPInterface::get_ip_address (SocketAddress *address)
96
96
{
97
- if (address) {
97
+ if (! address) {
98
98
return NSAPI_ERROR_PARAMETER;
99
99
}
100
100
@@ -108,6 +108,10 @@ nsapi_error_t PPPInterface::get_ip_address(SocketAddress *address)
108
108
109
109
nsapi_error_t PPPInterface::get_netmask (SocketAddress *address)
110
110
{
111
+ if (!address) {
112
+ return NSAPI_ERROR_PARAMETER;
113
+ }
114
+
111
115
if (_interface && _interface->get_netmask (address) == NSAPI_ERROR_OK) {
112
116
strncpy (_netmask, address->get_ip_address (), sizeof (_netmask));
113
117
return NSAPI_ERROR_OK;
@@ -118,6 +122,10 @@ nsapi_error_t PPPInterface::get_netmask(SocketAddress *address)
118
122
119
123
nsapi_error_t PPPInterface::get_gateway (SocketAddress *address)
120
124
{
125
+ if (!address) {
126
+ return NSAPI_ERROR_PARAMETER;
127
+ }
128
+
121
129
if (_interface && _interface->get_gateway (address) == NSAPI_ERROR_OK) {
122
130
strncpy (_gateway, address->get_ip_address (), sizeof (_gateway));
123
131
address->set_ip_address (_gateway);
You can’t perform that action at this time.
0 commit comments