diff options
author | lurchi <lurchi@strangeplace.net> | 2019-06-27 12:59:05 +0200 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2019-06-27 12:59:05 +0200 |
commit | 3ea320df4716a4ce16d738fa47bbe59740e36f42 (patch) | |
tree | c73de8a7095584cf24103bd3a87a6a49942dce73 /src/testbed/gnunet-service-testbed.c | |
parent | 40a111b93ce2d38b875c2eda3e23d6b89a256599 (diff) | |
download | gnunet-3ea320df4716a4ce16d738fa47bbe59740e36f42.tar.gz gnunet-3ea320df4716a4ce16d738fa47bbe59740e36f42.zip |
new GNUNET_strlcpy allows using it more
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); |