diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index d740d31bc..289e17349 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -541,15 +541,11 @@ handle_add_host (void *cls, | |||
541 | if (0 != username_length) | 541 | if (0 != username_length) |
542 | { | 542 | { |
543 | username = GNUNET_malloc (username_length + 1); | 543 | username = GNUNET_malloc (username_length + 1); |
544 | /* intentionally use strncpy (message payload is not null terminated) */ | 544 | GNUNET_strlcpy (username, ptr, username_length + 1); |
545 | strncpy (username, ptr, username_length); | ||
546 | ptr += username_length; | 545 | ptr += username_length; |
547 | } | 546 | } |
548 | hostname = GNUNET_malloc (hostname_length + 1); | 547 | hostname = GNUNET_malloc (hostname_length + 1); |
549 | /* intentionally use strncpy (message payload is not null terminated) */ | 548 | GNUNET_strlcpy (hostname, ptr, hostname_length + 1); |
550 | strncpy (hostname, | ||
551 | ptr, | ||
552 | hostname_length); | ||
553 | if (NULL == (host_cfg = GNUNET_TESTBED_extract_config_ (&msg->header))) | 549 | if (NULL == (host_cfg = GNUNET_TESTBED_extract_config_ (&msg->header))) |
554 | { | 550 | { |
555 | GNUNET_free_non_null (username); | 551 | GNUNET_free_non_null (username); |