diff options
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index df501fbcd..ce9bd6e46 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -1344,14 +1344,15 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc) | |||
1344 | const char * | 1344 | const char * |
1345 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) | 1345 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) |
1346 | { | 1346 | { |
1347 | static char buf[256]; | 1347 | static char buf[5]; |
1348 | char *ret; | 1348 | char *ret; |
1349 | 1349 | ||
1350 | if (NULL == pid) | 1350 | if (NULL == pid) |
1351 | return "NULL"; | 1351 | return "NULL"; |
1352 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); | 1352 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); |
1353 | strcpy (buf, | 1353 | strncpy (buf, |
1354 | ret); | 1354 | ret, |
1355 | sizeof (buf) - 1); | ||
1355 | GNUNET_free (ret); | 1356 | GNUNET_free (ret); |
1356 | buf[4] = '\0'; | 1357 | buf[4] = '\0'; |
1357 | return buf; | 1358 | return buf; |
@@ -1372,14 +1373,15 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) | |||
1372 | const char * | 1373 | const char * |
1373 | GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid) | 1374 | GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid) |
1374 | { | 1375 | { |
1375 | static char buf[256]; | 1376 | static char buf[5]; |
1376 | char *ret; | 1377 | char *ret; |
1377 | 1378 | ||
1378 | if (NULL == pid) | 1379 | if (NULL == pid) |
1379 | return "NULL"; | 1380 | return "NULL"; |
1380 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); | 1381 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); |
1381 | strcpy (buf, | 1382 | strncpy (buf, |
1382 | ret); | 1383 | ret, |
1384 | sizeof (buf) - 1); | ||
1383 | GNUNET_free (ret); | 1385 | GNUNET_free (ret); |
1384 | buf[4] = '\0'; | 1386 | buf[4] = '\0'; |
1385 | return buf; | 1387 | return buf; |