diff options
Diffstat (limited to 'src/testbed/testbed_api_hosts.c')
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index d6521f766..6dbd99bc9 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -462,11 +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 | /* | 465 | GNUNET_assert(0 != GNUNET_strlcpy (username, |
466 | * Intentionally use strncpy (buf is not necessarily null-terminated) | 466 | buf + pmatch[2].rm_so, |
467 | */ | 467 | size + 1)); |
468 | username[size] = '\0'; | ||
469 | GNUNET_assert (NULL != strncpy (username, buf + pmatch[2].rm_so, size)); | ||
470 | } | 468 | } |
471 | if (-1 != pmatch[5].rm_so) | 469 | if (-1 != pmatch[5].rm_so) |
472 | { | 470 | { |
@@ -474,11 +472,9 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
474 | } | 472 | } |
475 | size = pmatch[3].rm_eo - pmatch[3].rm_so; | 473 | size = pmatch[3].rm_eo - pmatch[3].rm_so; |
476 | hostname = GNUNET_malloc (size + 1); | 474 | hostname = GNUNET_malloc (size + 1); |
477 | /* | 475 | GNUNET_assert(0 != GNUNET_strlcpy (hostname, |
478 | * Intentionally use strncpy (buf is not necessarily null-terminated) | 476 | buf + pmatch[3].rm_so, |
479 | */ | 477 | size + 1)); |
480 | hostname[size] = '\0'; | ||
481 | GNUNET_assert (NULL != strncpy (hostname, buf + pmatch[3].rm_so, size)); | ||
482 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 478 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
483 | "Successfully read host %s, port %d and user %s from file\n", | 479 | "Successfully read host %s, port %d and user %s from file\n", |
484 | (NULL == hostname) ? "NULL" : hostname, | 480 | (NULL == hostname) ? "NULL" : hostname, |