From 160e76972a85398e1d8d19143c145cb8a6f6942e Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Mon, 14 Jan 2008 22:56:05 +0000 Subject: Fix issues which allow snooping on ptys. [08:01] Fix an off-by-one error in inet_network(3). [08:02] Security: FreeBSD-SA-08:01.pty Security: FreeBSD-SA-08:02.libc --- lib/libc/inet/inet_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/inet/inet_network.c') diff --git a/lib/libc/inet/inet_network.c b/lib/libc/inet/inet_network.c index b464656369f0..254db41acb2d 100644 --- a/lib/libc/inet/inet_network.c +++ b/lib/libc/inet/inet_network.c @@ -82,9 +82,9 @@ again: } if (!digit) return (INADDR_NONE); + if (pp >= parts + 4 || val > 0xffU) + return (INADDR_NONE); if (*cp == '.') { - if (pp >= parts + 4 || val > 0xffU) - return (INADDR_NONE); *pp++ = val, cp++; goto again; } -- cgit v1.2.3