From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C8143858423; Fri, 27 Aug 2021 17:31:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C8143858423 From: "roland.illig at gmx dot de" To: bzip2-devel@sourceware.org Subject: [Bug bzip2/28283] New: undefined behavior for isdigit and isspace Date: Fri, 27 Aug 2021 17:31:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: bzip2 X-Bugzilla-Component: bzip2 X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: roland.illig at gmx dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody 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 cc target_milestone 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: bzip2-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bzip2-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2021 17:31:37 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28283 Bug ID: 28283 Summary: undefined behavior for isdigit and isspace Product: bzip2 Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: bzip2 Assignee: nobody at sourceware dot org Reporter: roland.illig at gmx dot de CC: bzip2-devel at sourceware dot org Target Milestone: --- The functions from take an int as parameter. The value of this parameter must "either be representable as an unsigned char or be the value= of the macro EOF". The functions addFlagsFromEnvVar and bzopen_or_bzdopen wrongly cast the argument to Int32, the correct type is UChar. After a direct cast to Int32,= the argument may still be negative, which makes that cast wrong. --=20 You are receiving this mail because: You are on the CC list for the bug.=