From 33054bb2a8d6272e2f137e8be1833ff9e469c177 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Fri, 26 Mar 2021 22:32:12 +0100 Subject: -more coverity fixes --- src/revocation/gnunet-service-revocation.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/revocation/gnunet-service-revocation.c') diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index 7032921c6..6f70720ba 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c @@ -306,12 +306,19 @@ publicize_rm (const struct RevokeMessage *rm) struct RevokeMessage *cp; struct GNUNET_HashCode hc; struct GNUNET_SETU_Element e; + ssize_t pklen; const struct GNUNET_IDENTITY_PublicKey *pk; struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; + pklen = GNUNET_IDENTITY_key_get_length (pk); + if (0 > pklen) + { + GNUNET_break_op (0); + return GNUNET_SYSERR; + } GNUNET_CRYPTO_hash (pk, - GNUNET_IDENTITY_key_get_length (pk), + pklen, &hc); if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (revocation_map, -- cgit v1.2.3