aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/gnunet-service-revocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revocation/gnunet-service-revocation.c')
-rw-r--r--src/revocation/gnunet-service-revocation.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 863289aae..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)
306 struct RevokeMessage *cp; 306 struct RevokeMessage *cp;
307 struct GNUNET_HashCode hc; 307 struct GNUNET_HashCode hc;
308 struct GNUNET_SETU_Element e; 308 struct GNUNET_SETU_Element e;
309 ssize_t pklen;
309 const struct GNUNET_IDENTITY_PublicKey *pk; 310 const struct GNUNET_IDENTITY_PublicKey *pk;
310 311
311 struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; 312 struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1];
312 pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; 313 pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
314 pklen = GNUNET_IDENTITY_key_get_length (pk);
315 if (0 > pklen)
316 {
317 GNUNET_break_op (0);
318 return GNUNET_SYSERR;
319 }
313 GNUNET_CRYPTO_hash (pk, 320 GNUNET_CRYPTO_hash (pk,
314 GNUNET_IDENTITY_key_get_length (pk), 321 pklen,
315 &hc); 322 &hc);
316 if (GNUNET_YES == 323 if (GNUNET_YES ==
317 GNUNET_CONTAINER_multihashmap_contains (revocation_map, 324 GNUNET_CONTAINER_multihashmap_contains (revocation_map,
@@ -384,7 +391,8 @@ check_revoke_message (void *cls,
384 uint16_t size; 391 uint16_t size;
385 392
386 size = ntohs (rm->header.size); 393 size = ntohs (rm->header.size);
387 if (size <= sizeof(struct RevokeMessage)) 394 if (size <= sizeof(struct RevokeMessage) ||
395 (size > UINT16_MAX))
388 { 396 {
389 GNUNET_break (0); 397 GNUNET_break (0);
390 return GNUNET_SYSERR; 398 return GNUNET_SYSERR;