From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D73B13858404; Tue, 9 Apr 2024 19:19:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D73B13858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712690358; bh=xM232UQNNZOlAzE32C32FhFk/PMkA9bdCPD0ZngLUq4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uhpS3hw7mzvh2HGSURSRXClytm3s3tSnrA3IjFQfU4Ej+RJHtSw0KFBvR8oV3FN4D 1ILQjp5BdwUh+0zPDgOgZe9c5TlFxKZyOtiVWT+dmn+XK+wevUhcNeHuDOfO9IjKfy Im1viXL1G1dmiE9kBBwg8riSIp0ymGvpO4otNFz0= From: "mark at klomp dot org" To: bzip2-devel@sourceware.org Subject: [Bug bzip2/28283] undefined behavior for isdigit and isspace Date: Tue, 09 Apr 2024 19:19:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: mark at klomp dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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_status resolution Message-ID: In-Reply-To: References: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28283 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #4 from Mark Wielaard --- commit fbc4b11da543753b3b803e5546f56e26ec90c2a7 Author: Mark Wielaard Date: Tue Apr 9 21:11:02 2024 +0200 Make sure to call isdigit and isspace with unsigned char Casting to Int32 or int could create negative values. Which isspace and isdigit don't handle. SEI CERT C Coding Standard STR37-C. Resolve by casting to UChar or unsigned char instead of Int32 or int. https://sourceware.org/bugzilla/show_bug.cgi?id=3D28283 --=20 You are receiving this mail because: You are on the CC list for the bug.=