From 03561106495b1fc6f7ac21da51ac3aa8de6fbdf5 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 7 Jun 2014 05:19:14 +0200 Subject: add zero length check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mds-server/client.c b/src/mds-server/client.c index e99a92e..f927cb1 100644 --- a/src/mds-server/client.c +++ b/src/mds-server/client.c @@ -216,8 +216,9 @@ size_t client_unmarshal(client_t* restrict this, char* restrict data) buf_get_next(data, int, this->open); buf_get_next(data, uint64_t, this->id); buf_get_next(data, size_t, n); - if (mds_message_unmarshal(&(this->message), data)) - return 0; + if (n > 0) + if (mds_message_unmarshal(&(this->message), data)) + return 0; data += n / sizeof(char); rc += n; buf_get_next(data, size_t, this->interception_conditions_count); -- cgit v1.2.3-70-g09d2