diff options
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r-- | src/revocation/revocation_api.c | 9 |
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]); |