diff --git a/src/netevent.c b/src/netevent.c index 5831fad..304d4b8 100644 --- a/src/netevent.c +++ b/src/netevent.c @@ -174,7 +174,7 @@ int handle_net_read(struct user* user) } else { - if (g_hub->config->max_recv_buffer > (pos - start)) + if (((pos - start) > 0) && g_hub->config->max_recv_buffer > (pos - start)) { if (hub_handle_message(g_hub, user, start, (pos - start)) == -1) {