Changeset 8fc8969 in mainline for uspace/srv/net/udp/sock.c


Ignore:
Timestamp:
2013-03-13T17:11:27Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
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.