aboutsummaryrefslogtreecommitdiff
path: root/src/feature/rend/rendservice.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2018-08-28 18:32:31 +0300
committerrl1987 <rl1987@sdf.lonestar.org>2018-08-28 18:32:31 +0300
commit3890ad25787ad6142acd65d064168ead53e9a289 (patch)
tree07672746ad57cc070b00037b9ec86afcd23ba5dc /src/feature/rend/rendservice.c
parent103dd68ba8e1d0780dee1ef1c02ccd2ed6cc0542 (diff)
downloadtor-3890ad25787ad6142acd65d064168ead53e9a289.tar.gz
tor-3890ad25787ad6142acd65d064168ead53e9a289.zip
Stricter HiddenServicePort parsing
Diffstat (limited to 'src/feature/rend/rendservice.c')
-rw-r--r--src/feature/rend/rendservice.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/feature/rend/rendservice.c b/src/feature/rend/rendservice.c
index 1a99bd56ed..beb0040e5f 100644
--- a/src/feature/rend/rendservice.c
+++ b/src/feature/rend/rendservice.c
@@ -451,11 +451,19 @@ rend_service_parse_port_config(const char *string, const char *sep,
int is_unix;
ret = port_cfg_line_extract_addrport(addrport_element, &addrport,
&is_unix, &rest);
+
if (ret < 0) {
tor_asprintf(&err_msg, "Couldn't process address <%s> from hidden "
"service configuration", addrport_element);
goto err;
}
+
+ if (rest && strlen(rest)) {
+ err_msg = tor_strdup("HiddenServicePort parse error: invalid port "
+ "mapping");
+ goto err;
+ }
+
if (is_unix) {
socket_path = addrport;
is_unix_addr = 1;