aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-19 18:39:04 +0000
committerLRN <lrn1986@gmail.com>2013-12-19 18:39:04 +0000
commitaac71444fe489dcc0351043e26ec5781b9bbc148 (patch)
treee09a2c21628fac98b1816fefb812bd25568a691d
parent824a8c18fa56a90bdb07c437b2f086f57326c77c (diff)
downloadgnunet-aac71444fe489dcc0351043e26ec5781b9bbc148.tar.gz
gnunet-aac71444fe489dcc0351043e26ec5781b9bbc148.zip
Fix 0-terminator check, logging
-rw-r--r--src/gns/gnunet-gns-helper-service-w32.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c
index 2d79c3aae..b27387e1a 100644
--- a/src/gns/gnunet-gns-helper-service-w32.c
+++ b/src/gns/gnunet-gns-helper-service-w32.c
@@ -694,10 +694,12 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
694 sc.Data4[3], sc.Data4[4], sc.Data4[5], sc.Data4[6], sc.Data4[7]); 694 sc.Data4[3], sc.Data4[4], sc.Data4[5], sc.Data4[6], sc.Data4[7]);
695 695
696 hostname = (const wchar_t *) &msg[1]; 696 hostname = (const wchar_t *) &msg[1];
697 if (hostname[size - 1] != L'\0') 697 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "name of %u bytes (last word is 0x%0X): %*S\n",
698 size, hostname[size / 2 - 2], size / 2, hostname);
699 if (hostname[size / 2 - 1] != L'\0')
698 { 700 {
699 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "name of length %u, not 0-terminated: %*S\n", 701 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "name of length %u, not 0-terminated (%d-th word is 0x%0X): %*S\n",
700 size, size, hostname); 702 size, size / 2 - 1, hostname[size / 2 - 1], size, hostname);
701 GNUNET_break (0); 703 GNUNET_break (0);
702 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 704 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
703 return; 705 return;