From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 167A83858413; Tue, 14 Sep 2021 05:47:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 167A83858413 From: "eggert at cs dot ucla.edu" To: glibc-bugs@sourceware.org Subject: [Bug time/28338] New: undefined behavior in __tzfile_compute with oddball TZif file Date: Tue, 14 Sep 2021 05:47:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: time X-Bugzilla-Version: 2.34 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eggert at cs dot ucla.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 05:47:13 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28338 Bug ID: 28338 Summary: undefined behavior in __tzfile_compute with oddball TZif file Product: glibc Version: 2.34 Status: NEW Severity: normal Priority: P2 Component: time Assignee: unassigned at sourceware dot org Reporter: eggert at cs dot ucla.edu Target Milestone: --- Created attachment 13665 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D13665&action=3Ded= it Fix access before array start in __tzfile_compute. __tzfile_compute reads before the beginning of an array when given a weird-but-valid TZif file and a localtime request exactly matching a negati= ve leap second. Patch attached. The bug in the unpatched version occurs when (= i =3D=3D 0 && leaps[i].change <=3D 0); the code goes on to access leaps[-1] which is= out of the array bounds. --=20 You are receiving this mail because: You are on the CC list for the bug.=