From: serassio <> Date: Sat, 26 Aug 2006 18:24:12 +0000 (+0000) Subject: Bug #1706: Squid time acl accepts invalid time range. X-Git-Tag: SQUID_3_0_PRE5~171 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0699d0106566665fed7518819e5a3ccad013b41;p=thirdparty%2Fsquid.git Bug #1706: Squid time acl accepts invalid time range. --- diff --git a/src/ACLTimeData.cc b/src/ACLTimeData.cc index 8e6f0b451d..ef8ac5d395 100644 --- a/src/ACLTimeData.cc +++ b/src/ACLTimeData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLTimeData.cc,v 1.11 2006/04/23 11:10:31 robertc Exp $ + * $Id: ACLTimeData.cc,v 1.12 2006/08/26 12:24:12 serassio Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -190,7 +190,7 @@ ACLTimeData::parse() } else { /* assume its time-of-day spec */ - if (sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) { + if ((sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) || (!((h1 >= 0 && h1 < 24) && (h2 >= 0 && h2 < 24) && (m1 >= 0 && m1 < 60) && (m2 >= 0 && m2 < 60)))) { debug(28, 0) ("aclParseTimeSpec: Bad time range '%s'\n", t); self_destruct();