summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/addrmatch.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2012-06-21 00:16:08 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2012-06-21 00:16:08 +0000
commit28222fd1268ab97426703666e99f70ed942e847b (patch)
tree32696f94a7001d70ec64dfbb431265bbea0ab0d2 /usr.bin/ssh/addrmatch.c
parentaf08d76f4cc5e76cff85276f5a8259cf897cdd6d (diff)
fix strlcpy truncation check. from carsten at debian org, ok markus
Diffstat (limited to 'usr.bin/ssh/addrmatch.c')
-rw-r--r--usr.bin/ssh/addrmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/addrmatch.c b/usr.bin/ssh/addrmatch.c
index 3c0953827c8..e5b1e697c86 100644
--- a/usr.bin/ssh/addrmatch.c
+++ b/usr.bin/ssh/addrmatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: addrmatch.c,v 1.5 2010/02/26 20:29:54 djm Exp $ */
+/* $OpenBSD: addrmatch.c,v 1.6 2012/06/21 00:16:07 dtucker Exp $ */
/*
* Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org>
@@ -314,7 +314,7 @@ addr_pton_cidr(const char *p, struct xaddr *n, u_int *l)
char addrbuf[64], *mp, *cp;
/* Don't modify argument */
- if (p == NULL || strlcpy(addrbuf, p, sizeof(addrbuf)) > sizeof(addrbuf))
+ if (p == NULL || strlcpy(addrbuf, p, sizeof(addrbuf)) >= sizeof(addrbuf))
return -1;
if ((mp = strchr(addrbuf, '/')) != NULL) {