From 41f06b9223347f779237d0d56ef8fe9e2d813789 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 25 Jun 2016 17:32:18 +0000 Subject: [PATCH] -cosmetics --- src/identity/identity_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 598f6085f..215433704 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c @@ -477,11 +477,11 @@ static int check_identity_set_default (void *cls, const struct GNUNET_IDENTITY_SetDefaultMessage *sdm) { - uint16_t size = ntohs (sdm->header.size); + uint16_t size = ntohs (sdm->header.size) - sizeof (*sdm); uint16_t name_len = ntohs (sdm->name_len); const char *str = (const char *) &sdm[1]; - if ( (size != name_len + sizeof (struct GNUNET_IDENTITY_SetDefaultMessage)) || + if ( (size != name_len) || ( (0 != name_len) && ('\0' != str[name_len - 1]) ) ) { -- 2.25.1