Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 8fc8969 in mainline


Ignore:
Timestamp:
2013-03-13T17:11:27Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
451481c8
Parents:
0ee053c1
Message:

check address size before calling socket_bind()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/sock.c

    r0ee053c1 r8fc8969  
    177177                goto out;
    178178        }
    179 
     179       
     180        if (addr_size != sizeof(struct sockaddr_in)) {
     181                async_answer_0(callid, EINVAL);
     182                goto out;
     183        }
     184       
    180185        log_msg(LOG_DEFAULT, LVL_DEBUG, " - call socket_bind");
    181186        rc = socket_bind(&client->sockets, &gsock, SOCKET_GET_SOCKET_ID(call),
     
    186191                goto out;
    187192        }
    188 
    189         if (addr_size != sizeof(struct sockaddr_in)) {
    190                 async_answer_0(callid, EINVAL);
    191                 goto out;
    192         }
    193 
     193       
    194194        log_msg(LOG_DEFAULT, LVL_DEBUG, " - call socket_cores_find");
    195195        sock_core = socket_cores_find(&client->sockets, SOCKET_GET_SOCKET_ID(call));
Note: See TracChangeset for help on using the changeset viewer.