returning NULL on invalid packet in read_socket_raw
This commit is contained in:
parent
e688023383
commit
2586f1a937
@ -247,6 +247,8 @@ char *read_socket_raw(int socket, char *key)
|
||||
//FIND THE RECEIVED SIZE
|
||||
ioctl(socket, FIONREAD, &content_size);
|
||||
|
||||
if (content_size == 0) return NULL; //CLIENT PROBABLY QUIT
|
||||
|
||||
//ALLOCATE
|
||||
content_buffer = why2_malloc(content_size + 1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user