aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_descriptor.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-08-17 23:13:15 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-08-21 19:16:45 +0300
commit1491c0d024130a5699ae9acbeb2263d9d6ca2c3c (patch)
treeab30ca177cb6baa196ee08e01f53e1d849026269 /src/or/hs_descriptor.c
parent45732a1a13cb05107f5822afed0c01388096be27 (diff)
downloadtor-1491c0d024130a5699ae9acbeb2263d9d6ca2c3c.tar.gz
tor-1491c0d024130a5699ae9acbeb2263d9d6ca2c3c.zip
Fix triggerable BUG() when decoding hsv3 descriptors.
Also improve the unittest to make sure it catches the right error.
Diffstat (limited to 'src/or/hs_descriptor.c')
-rw-r--r--src/or/hs_descriptor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
index 7c2e76942a..616d2f280b 100644
--- a/src/or/hs_descriptor.c
+++ b/src/or/hs_descriptor.c
@@ -1852,7 +1852,8 @@ desc_sig_is_valid(const char *b64_sig,
sig_start = tor_memstr(encoded_desc, encoded_len, "\n" str_signature);
/* Getting here means the token parsing worked for the signature so if we
* can't find the start of the signature, we have a code flow issue. */
- if (BUG(!sig_start)) {
+ if (!sig_start) {
+ log_warn(LD_GENERAL, "Malformed signature line. Rejecting.");
goto err;
}
/* Skip newline, it has to go in the signature check. */