diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2008-06-10 05:22:46 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2008-06-10 05:22:46 +0000 |
commit | 42bf7dbf41b88c5cd9880fd14edb6711b83c5547 (patch) | |
tree | 06c43243716097aa09bfd2db174c646daa4142f1 /usr.bin | |
parent | 957d1787f9bc2f98d871edd683475f8763d55936 (diff) |
fix fatal() when performing address matching and connection is
not on socket; spotted by & ok dtucker@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/addrmatch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/addrmatch.c b/usr.bin/ssh/addrmatch.c index 7198c28677e..bc267834583 100644 --- a/usr.bin/ssh/addrmatch.c +++ b/usr.bin/ssh/addrmatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: addrmatch.c,v 1.1 2008/06/10 03:57:27 djm Exp $ */ +/* $OpenBSD: addrmatch.c,v 1.2 2008/06/10 05:22:45 djm Exp $ */ /* * Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org> @@ -374,8 +374,10 @@ addr_match_list(const char *addr, const char *_list) u_int masklen, neg; int ret = 0, r; - if (addr != NULL && addr_pton(addr, &try_addr) != 0) - fatal("%s: addr_pton(%s)", __func__, addr); + if (addr != NULL && addr_pton(addr, &try_addr) != 0) { + debug2("%s: couldn't parse address %.100s", __func__, addr); + return 0; + } if ((o = list = strdup(_list)) == NULL) return -1; while ((cp = strsep(&list, ",")) != NULL) { |