aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-18 21:24:16 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-18 21:24:16 -0400
commitd4ad254917ffa0dfba371624f72bc9e163645b8e (patch)
tree0b812c7ed111c5681f0c42393ba219044b0934c4 /src/or
parent1b3bddd013dab6d0aa8159e1690d944e226ed77f (diff)
downloadtor-d4ad254917ffa0dfba371624f72bc9e163645b8e.tar
tor-d4ad254917ffa0dfba371624f72bc9e163645b8e.tar.gz
scan-build: bulletproof last-chance errormsg generation in rendservice.c
If 'intro' is NULL in these functions, I'm pretty sure that the error message must be set before we hit the end. But scan-build doesn't notice that, and is worried that we'll do a null-pointer dereference in the last-chance errormsg generation.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/rendservice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index abd78da73..5a81d0785 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -2041,7 +2041,7 @@ rend_service_decrypt_intro(
if (err_msg_out && !err_msg) {
tor_asprintf(&err_msg,
"unknown INTRODUCE%d error decrypting encrypted part",
- (int)(intro->type));
+ intro ? (int)(intro->type) : -1);
}
if (status >= 0) status = -1;
@@ -2147,7 +2147,7 @@ rend_service_parse_intro_plaintext(
if (err_msg_out && !err_msg) {
tor_asprintf(&err_msg,
"unknown INTRODUCE%d error parsing encrypted part",
- (int)(intro->type));
+ intro ? (int)(intro->type) : -1);
}
if (status >= 0) status = -1;