codesonar finding 1575.9537
authort3sserakt <t3ss@posteo.de>
Tue, 26 Jun 2018 12:30:18 +0000 (14:30 +0200)
committert3sserakt <t3ss@posteo.de>
Tue, 26 Jun 2018 12:30:18 +0000 (14:30 +0200)
src/cadet/gnunet-service-cadet_peer.c

index 8e536e376ebea233889c25833e9c821c39888985..53c51c27a95a508b1f1051efcf02f02c3e449e76 100644 (file)
@@ -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);