From 98bffd93e9f2646e5905dfeab270284cd8e80341 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Wed, 1 Jul 2009 11:31:55 +0200 Subject: [PATCH] Fix stupid crash on empty command. --- src/netevent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {