From 1491c0d024130a5699ae9acbeb2263d9d6ca2c3c Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Thu, 17 Aug 2017 23:13:15 +0300 Subject: Fix triggerable BUG() when decoding hsv3 descriptors. Also improve the unittest to make sure it catches the right error. --- src/or/hs_descriptor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/or/hs_descriptor.c') 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. */ -- cgit v1.2.3-54-g00ecf