diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/readconf.c b/readconf.c index 0a8be1400..53fc6c7ba 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.175 2009/01/22 10:02:34 djm Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.176 2009/02/12 03:00:56 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -735,7 +735,8 @@ parse_int: | |||
735 | } | 735 | } |
736 | 736 | ||
737 | if (parse_forward(&fwd, fwdarg, | 737 | if (parse_forward(&fwd, fwdarg, |
738 | opcode == oDynamicForward ? 1 : 0) == 0) | 738 | opcode == oDynamicForward ? 1 : 0, |
739 | opcode == oRemoteForward ? 1 : 0) == 0) | ||
739 | fatal("%.200s line %d: Bad forwarding specification.", | 740 | fatal("%.200s line %d: Bad forwarding specification.", |
740 | filename, linenum); | 741 | filename, linenum); |
741 | 742 | ||
@@ -1220,7 +1221,7 @@ fill_default_options(Options * options) | |||
1220 | * returns number of arguments parsed or zero on error | 1221 | * returns number of arguments parsed or zero on error |
1221 | */ | 1222 | */ |
1222 | int | 1223 | int |
1223 | parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd) | 1224 | parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd, int remotefwd) |
1224 | { | 1225 | { |
1225 | int i; | 1226 | int i; |
1226 | char *p, *cp, *fwdarg[4]; | 1227 | char *p, *cp, *fwdarg[4]; |
@@ -1283,12 +1284,16 @@ parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd) | |||
1283 | goto fail_free; | 1284 | goto fail_free; |
1284 | } | 1285 | } |
1285 | 1286 | ||
1286 | if (fwd->listen_port <= 0) | 1287 | if (fwd->listen_port < 0 || (!remotefwd && fwd->listen_port == 0)) |
1287 | goto fail_free; | 1288 | goto fail_free; |
1288 | 1289 | ||
1289 | if (fwd->connect_host != NULL && | 1290 | if (fwd->connect_host != NULL && |
1290 | strlen(fwd->connect_host) >= NI_MAXHOST) | 1291 | strlen(fwd->connect_host) >= NI_MAXHOST) |
1291 | goto fail_free; | 1292 | goto fail_free; |
1293 | if (fwd->listen_host != NULL && | ||
1294 | strlen(fwd->listen_host) >= NI_MAXHOST) | ||
1295 | goto fail_free; | ||
1296 | |||
1292 | 1297 | ||
1293 | return (i); | 1298 | return (i); |
1294 | 1299 | ||