aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-03-24 10:46:39 -0400
committerNick Mathewson <nickm@torproject.org>2015-03-24 10:46:39 -0400
commitfec923d72b2cb40f4d696cc1d2306d4c5779bed0 (patch)
tree61535cb78029a9a2124106bf5cd04d3a6bce4754 /src/or/config.c
parent572b9ff4d7937a568bc786f7dce08b34011de7d9 (diff)
downloadtor-fec923d72b2cb40f4d696cc1d2306d4c5779bed0.tar.gz
tor-fec923d72b2cb40f4d696cc1d2306d4c5779bed0.zip
Check return values for tor_addr_parse(default) in config.c
In these cases, the address is always a constant "default", so should always succeed. But coverity can't tell that. Fixes CID 1291645
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index fca350c203..cfa5aa7c07 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -5934,7 +5934,8 @@ parse_port_config(smartlist_t *out,
port = 1;
} else if (!strcmp(addrport, "auto")) {
port = CFG_AUTO_PORT;
- tor_addr_parse(&addr, defaultaddr);
+ int af = tor_addr_parse(&addr, defaultaddr);
+ tor_assert(af >= 0);
} else if (!strcasecmpend(addrport, ":auto")) {
char *addrtmp = tor_strndup(addrport, strlen(addrport)-5);
port = CFG_AUTO_PORT;
@@ -5949,7 +5950,8 @@ parse_port_config(smartlist_t *out,
"9050" might be a valid address. */
port = (int) tor_parse_long(addrport, 10, 0, 65535, &ok, NULL);
if (ok) {
- tor_addr_parse(&addr, defaultaddr);
+ int af = tor_addr_parse(&addr, defaultaddr);
+ tor_assert(af >= 0);
} else if (tor_addr_port_lookup(addrport, &addr, &ptmp) == 0) {
if (ptmp == 0) {
log_warn(LD_CONFIG, "%sPort line has address but no port", portname);