aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/revocation_api.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-03-26 22:32:12 +0100
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-03-26 22:32:12 +0100
commit33054bb2a8d6272e2f137e8be1833ff9e469c177 (patch)
treec78739fcf778dc56540877d255ae25766255a672 /src/revocation/revocation_api.c
parent040ebbd2039e5ae0ba93ad3b7976721088ff6294 (diff)
downloadgnunet-33054bb2a8d6272e2f137e8be1833ff9e469c177.tar.gz
gnunet-33054bb2a8d6272e2f137e8be1833ff9e469c177.zip
-more coverity fixes
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r--src/revocation/revocation_api.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 5cf191847..e2f871c23 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -492,6 +492,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
492 unsigned int tmp_score = 0; 492 unsigned int tmp_score = 0;
493 unsigned int epochs; 493 unsigned int epochs;
494 uint64_t pow_val; 494 uint64_t pow_val;
495 ssize_t pklen;
495 const struct GNUNET_IDENTITY_PublicKey *pk; 496 const struct GNUNET_IDENTITY_PublicKey *pk;
496 497
497 pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; 498 pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
@@ -517,9 +518,15 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
517 GNUNET_memcpy (&buf[sizeof(uint64_t)], 518 GNUNET_memcpy (&buf[sizeof(uint64_t)],
518 &pow->timestamp, 519 &pow->timestamp,
519 sizeof (uint64_t)); 520 sizeof (uint64_t));
521 pklen = GNUNET_IDENTITY_key_get_length (pk);
522 if (0 > pklen)
523 {
524 GNUNET_break (0);
525 return GNUNET_NO;
526 }
520 GNUNET_memcpy (&buf[sizeof(uint64_t) * 2], 527 GNUNET_memcpy (&buf[sizeof(uint64_t) * 2],
521 pk, 528 pk,
522 GNUNET_IDENTITY_key_get_length (pk)); 529 pklen);
523 for (unsigned int i = 0; i < POW_COUNT; i++) 530 for (unsigned int i = 0; i < POW_COUNT; i++)
524 { 531 {
525 pow_val = GNUNET_ntohll (pow->pow[i]); 532 pow_val = GNUNET_ntohll (pow->pow[i]);