diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-05-15 20:26:44 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-05-15 20:26:44 +0200 |
commit | c2cd7ec031ff925294b5c4c0c992fe9014846430 (patch) | |
tree | 9f247d89e321f1323a5276f9bba926eec7ab1b06 /src/revocation/gnunet-service-revocation.c | |
parent | 6d40171315d344d8a62d611df200d43f1fefc238 (diff) | |
download | gnunet-c2cd7ec031ff925294b5c4c0c992fe9014846430.tar.gz gnunet-c2cd7ec031ff925294b5c4c0c992fe9014846430.zip |
-coverity: handle invalid key length
Diffstat (limited to 'src/revocation/gnunet-service-revocation.c')
-rw-r--r-- | src/revocation/gnunet-service-revocation.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index 6f70720ba..2d8111adb 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c | |||
@@ -943,9 +943,17 @@ run (void *cls, | |||
943 | } | 943 | } |
944 | struct GNUNET_REVOCATION_PowP *pow = (struct | 944 | struct GNUNET_REVOCATION_PowP *pow = (struct |
945 | GNUNET_REVOCATION_PowP *) &rm[1]; | 945 | GNUNET_REVOCATION_PowP *) &rm[1]; |
946 | ssize_t ksize; | ||
946 | pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; | 947 | pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; |
948 | ksize = GNUNET_IDENTITY_key_get_length (pk); | ||
949 | if (0 > ksize) | ||
950 | { | ||
951 | GNUNET_break_op (0); | ||
952 | GNUNET_free (fn); | ||
953 | return; | ||
954 | } | ||
947 | GNUNET_CRYPTO_hash (pk, | 955 | GNUNET_CRYPTO_hash (pk, |
948 | GNUNET_IDENTITY_key_get_length (pk), | 956 | ksize, |
949 | &hc); | 957 | &hc); |
950 | GNUNET_break (GNUNET_OK == | 958 | GNUNET_break (GNUNET_OK == |
951 | GNUNET_CONTAINER_multihashmap_put (revocation_map, | 959 | GNUNET_CONTAINER_multihashmap_put (revocation_map, |