From 4af6e380bbda66c267737c753ee8357c8b99b0fa Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Tue, 26 Jun 2018 14:30:18 +0200 Subject: [PATCH] codesonar finding 1575.9537 --- src/cadet/gnunet-service-cadet_peer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 8e536e376..53c51c27a 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -243,7 +243,11 @@ GCP_2s (const struct CadetPeer *cp) static char buf[5]; char *ret; + if (NULL == cp || NULL == &cp->pid.public_key) + return "NULL"; ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&cp->pid.public_key); + if (NULL == ret) + return "NULL"; strncpy (buf, ret, sizeof (buf) - 1); -- 2.25.1