diff --git a/common/socket_helper.c b/common/socket_helper.c index 48cb75e..f9ffa64 100644 --- a/common/socket_helper.c +++ b/common/socket_helper.c @@ -247,7 +247,8 @@ enum socket_read_result get_all_remote_parts(int socket_fd, enum socket_type typ body_result = read_body_by_content_length(socket_fd, net_content_length); } else if (read_info.strategy == STRATEGY_EOF && type == TYPE_SERVER) { // Servers cannot just wait for EOF with a client, so we just skip the action. - body_result = "\0"; + body_result = malloc(1 * sizeof(char)); + *body_result = '\0'; } else { // In all other cases, such as if we have EOF strategy on a client. body_result = read_body_until_eof(socket_fd);