diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_logging.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index dad5d3776..1da406753 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -1209,8 +1209,11 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) | |||
1209 | static char buf[256]; | 1209 | static char buf[256]; |
1210 | char *ret; | 1210 | char *ret; |
1211 | 1211 | ||
1212 | if (NULL == pid) | ||
1213 | return "NULL"; | ||
1212 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); | 1214 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); |
1213 | strcpy (buf, ret); | 1215 | strcpy (buf, |
1216 | ret); | ||
1214 | GNUNET_free (ret); | 1217 | GNUNET_free (ret); |
1215 | buf[4] = '\0'; | 1218 | buf[4] = '\0'; |
1216 | return buf; | 1219 | return buf; |
@@ -1234,8 +1237,11 @@ GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid) | |||
1234 | static char buf[256]; | 1237 | static char buf[256]; |
1235 | char *ret; | 1238 | char *ret; |
1236 | 1239 | ||
1240 | if (NULL == pid) | ||
1241 | return "NULL"; | ||
1237 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); | 1242 | ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); |
1238 | strcpy (buf, ret); | 1243 | strcpy (buf, |
1244 | ret); | ||
1239 | GNUNET_free (ret); | 1245 | GNUNET_free (ret); |
1240 | buf[4] = '\0'; | 1246 | buf[4] = '\0'; |
1241 | return buf; | 1247 | return buf; |