[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] scan-build: get_proxy_addrport should always set its outputs
commit 895b6789e8b33af180a00d843eb25343bace4a4d
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri Apr 18 20:41:40 2014 -0400
scan-build: get_proxy_addrport should always set its outputs
When get_proxy_addrport returned PROXY_NONE, it would leave
addr/port unset. This is inconsistent, and could (if we used the
function in a stupid way) lead to undefined behavior. Bugfix on
5b050a9b0, though I don't think it affects tor-as-it-is.
---
src/or/connection.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/or/connection.c b/src/or/connection.c
index 2e72e6b..5dbc477 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -4814,6 +4814,8 @@ get_proxy_addrport(tor_addr_t *addr, uint16_t *port, int *proxy_type,
}
}
+ tor_addr_make_unspec(addr);
+ *port = 0;
*proxy_type = PROXY_NONE;
return 0;
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits