summaryrefslogtreecommitdiffstats
path: root/addrmatch.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2012-06-30 00:32:29 +0200
committerDamien Miller <djm@mindrot.org>2012-06-30 00:32:29 +0200
commit97f43bbfc9be102ca285af28afc288d90afa6712 (patch)
tree58c167cc9ea7b3a731f42ac361fd0e992752e867 /addrmatch.c
parent - (dtucker) [openbsd-compat/getrrsetbyname-ldns.c] bz #2022: prevent null (diff)
downloadopenssh-97f43bbfc9be102ca285af28afc288d90afa6712.tar.xz
openssh-97f43bbfc9be102ca285af28afc288d90afa6712.zip
- dtucker@cvs.openbsd.org 2012/06/21 00:16:07
[addrmatch.c] fix strlcpy truncation check. from carsten at debian org, ok markus
Diffstat (limited to 'addrmatch.c')
-rw-r--r--addrmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/addrmatch.c b/addrmatch.c
index 5b6773cce..388603cae 100644
--- a/addrmatch.c
+++ b/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>
@@ -318,7 +318,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) {