From: LRN Date: Sun, 30 Sep 2012 16:25:49 +0000 (+0000) Subject: Fix 0-terminator test in lockmanager X-Git-Tag: initial-import-from-subversion-38251~11540 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=afa2eab6a2f761058ee4c3924ca4707e3d96513f;p=oweals%2Fgnunet.git Fix 0-terminator test in lockmanager --- diff --git a/src/lockmanager/gnunet-service-lockmanager.c b/src/lockmanager/gnunet-service-lockmanager.c index 9d69a180a..296dd0065 100644 --- a/src/lockmanager/gnunet-service-lockmanager.c +++ b/src/lockmanager/gnunet-service-lockmanager.c @@ -576,8 +576,11 @@ handle_acquire (void *cls, struct GNUNET_SERVER_Client *client, request = (struct GNUNET_LOCKMANAGER_Message *) message; domain_name = (const char *) &request[1]; msize -= sizeof (struct GNUNET_LOCKMANAGER_Message); - if ('\0' != domain_name[msize]) + if ('\0' != domain_name[msize - 1]) { + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Bad domain `%.*s' - byte with index %u is %X, not 0.\n", msize, + domain_name, msize - 1, (unsigned int) domain_name[msize - 1]); GNUNET_break (0); GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); return;