projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02132e8
)
allow NULL argument for GNUNET_i2s()
author
Christian Grothoff
<christian@grothoff.org>
Sun, 22 Jan 2017 11:23:08 +0000
(12:23 +0100)
committer
Christian Grothoff
<christian@grothoff.org>
Sun, 22 Jan 2017 11:23:08 +0000
(12:23 +0100)
src/util/common_logging.c
patch
|
blob
|
history
diff --git
a/src/util/common_logging.c
b/src/util/common_logging.c
index dad5d3776d762bd6e5386f8a59ec1a16302890bf..1da40675373731a41b3491da9709246291ecd034 100644
(file)
--- a/
src/util/common_logging.c
+++ b/
src/util/common_logging.c
@@
-1209,8
+1209,11
@@
GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
static char buf[256];
char *ret;
+ if (NULL == pid)
+ return "NULL";
ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
- strcpy (buf, ret);
+ strcpy (buf,
+ ret);
GNUNET_free (ret);
buf[4] = '\0';
return buf;
@@
-1234,8
+1237,11
@@
GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid)
static char buf[256];
char *ret;
+ if (NULL == pid)
+ return "NULL";
ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
- strcpy (buf, ret);
+ strcpy (buf,
+ ret);
GNUNET_free (ret);
buf[4] = '\0';
return buf;