diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-15 09:25:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-15 09:25:42 +0000 |
commit | 5cba9a1df5ff320c75d7833439fc12f8304f2f98 (patch) | |
tree | 6fbc54e5690f4304bb47f4ad8e6cab7abdc96ad3 /src/hostlist/test_gnunet_daemon_hostlist_learning.c | |
parent | 76a45b2a02fb085b2648af475a20bb8980dbd35c (diff) | |
download | gnunet-5cba9a1df5ff320c75d7833439fc12f8304f2f98.tar.gz gnunet-5cba9a1df5ff320c75d7833439fc12f8304f2f98.zip |
fix
Diffstat (limited to 'src/hostlist/test_gnunet_daemon_hostlist_learning.c')
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_learning.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 6124ba33f..3134f22ae 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c | |||
@@ -333,6 +333,7 @@ ad_arrive_handler (void *cls, | |||
333 | char *expected_uri; | 333 | char *expected_uri; |
334 | unsigned long long port; | 334 | unsigned long long port; |
335 | const struct GNUNET_MessageHeader * incoming; | 335 | const struct GNUNET_MessageHeader * incoming; |
336 | const char *end; | ||
336 | 337 | ||
337 | if (-1 == GNUNET_CONFIGURATION_get_value_number (adv_peer.cfg, | 338 | if (-1 == GNUNET_CONFIGURATION_get_value_number (adv_peer.cfg, |
338 | "HOSTLIST", | 339 | "HOSTLIST", |
@@ -354,7 +355,13 @@ ad_arrive_handler (void *cls, | |||
354 | hostname != NULL ? hostname : "localhost", | 355 | hostname != NULL ? hostname : "localhost", |
355 | (unsigned int) port); | 356 | (unsigned int) port); |
356 | incoming = (const struct GNUNET_MessageHeader *) message; | 357 | incoming = (const struct GNUNET_MessageHeader *) message; |
357 | current_adv_uri = strdup ((char*) &incoming[1]); | 358 | end = (const char*) &incoming[1]; |
359 | if ('\0' != end[ntohs(message->size) - sizeof (struct GNUNET_MessageHeader) - 1]) | ||
360 | { | ||
361 | GNUNET_break (0); | ||
362 | return GNUNET_SYSERR; | ||
363 | } | ||
364 | current_adv_uri = GNUNET_strdup (end); | ||
358 | if ( 0 == strcmp( expected_uri, current_adv_uri ) ) | 365 | if ( 0 == strcmp( expected_uri, current_adv_uri ) ) |
359 | { | 366 | { |
360 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 367 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |