diff --git a/src/chat/server/main.c b/src/chat/server/main.c index 0c1e1c6..b0c2f92 100644 --- a/src/chat/server/main.c +++ b/src/chat/server/main.c @@ -79,6 +79,12 @@ char *read_socket(int socket) //COUNT content_size ioctl(socket, FIONREAD, &content_size); + if (content_size == 0) + { + fprintf(stderr, "Reading socket failed."); + return NULL; + } + //ALLOCATE content = why2_calloc(content_size + 1, sizeof(char));