diff options
Diffstat (limited to 'src/testbed/testbed_api_hosts.c')
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 327f84f2a..d6521f766 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -462,6 +462,9 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
462 | { | 462 | { |
463 | size = pmatch[2].rm_eo - pmatch[2].rm_so; | 463 | size = pmatch[2].rm_eo - pmatch[2].rm_so; |
464 | username = GNUNET_malloc (size + 1); | 464 | username = GNUNET_malloc (size + 1); |
465 | /* | ||
466 | * Intentionally use strncpy (buf is not necessarily null-terminated) | ||
467 | */ | ||
465 | username[size] = '\0'; | 468 | username[size] = '\0'; |
466 | GNUNET_assert (NULL != strncpy (username, buf + pmatch[2].rm_so, size)); | 469 | GNUNET_assert (NULL != strncpy (username, buf + pmatch[2].rm_so, size)); |
467 | } | 470 | } |
@@ -471,6 +474,9 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
471 | } | 474 | } |
472 | size = pmatch[3].rm_eo - pmatch[3].rm_so; | 475 | size = pmatch[3].rm_eo - pmatch[3].rm_so; |
473 | hostname = GNUNET_malloc (size + 1); | 476 | hostname = GNUNET_malloc (size + 1); |
477 | /* | ||
478 | * Intentionally use strncpy (buf is not necessarily null-terminated) | ||
479 | */ | ||
474 | hostname[size] = '\0'; | 480 | hostname[size] = '\0'; |
475 | GNUNET_assert (NULL != strncpy (hostname, buf + pmatch[3].rm_so, size)); | 481 | GNUNET_assert (NULL != strncpy (hostname, buf + pmatch[3].rm_so, size)); |
476 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 482 | LOG (GNUNET_ERROR_TYPE_DEBUG, |