From afa2eab6a2f761058ee4c3924ca4707e3d96513f Mon Sep 17 00:00:00 2001 From: LRN Date: Sun, 30 Sep 2012 16:25:49 +0000 Subject: [PATCH] Fix 0-terminator test in lockmanager --- src/lockmanager/gnunet-service-lockmanager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.25.1