summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/addrmatch.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2008-06-10 05:22:45 +0000
committerdjm <djm@openbsd.org>2008-06-10 05:22:45 +0000
commit952f5cdce3beaa80d977e38385fa3628d809da7d (patch)
tree265ef3ec642a1a8690bc4efbf4dcbed8223c1a38 /usr.bin/ssh/addrmatch.c
parentWe have a cvs_buf_puts implementation now, also use cvs_buf_putc instead (diff)
downloadwireguard-openbsd-952f5cdce3beaa80d977e38385fa3628d809da7d.tar.xz
wireguard-openbsd-952f5cdce3beaa80d977e38385fa3628d809da7d.zip
fix fatal() when performing address matching and connection is
not on socket; spotted by & ok dtucker@
Diffstat (limited to 'usr.bin/ssh/addrmatch.c')
-rw-r--r--usr.bin/ssh/addrmatch.c8
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) {