added empty content check to read_socket

This commit is contained in:
Václav Šmejkal 2023-02-18 17:05:30 +01:00
parent 72305929b2
commit 3a4f5ed7b6
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -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));