aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-07 05:19:14 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-07 05:19:14 +0200
commit03561106495b1fc6f7ac21da51ac3aa8de6fbdf5 (patch)
tree6f51f9b0f5639fb0d4a4b17a04289f664f089108
parentfix errors in client marshalling (diff)
downloadmds-03561106495b1fc6f7ac21da51ac3aa8de6fbdf5.tar.gz
mds-03561106495b1fc6f7ac21da51ac3aa8de6fbdf5.tar.bz2
mds-03561106495b1fc6f7ac21da51ac3aa8de6fbdf5.tar.xz
add zero length check
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-server/client.c5
1 files changed, 3 insertions, 2 deletions
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);