From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Klausner Newsgroups: gmane.emacs.bugs Subject: bug#73307: Fix ctype(3) usage Date: Tue, 17 Sep 2024 13:55:59 +0200 Message-ID: References: <86r09ibiq3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11901"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73307@debbugs.gnu.org, Paul Eggert To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 17 13:57:20 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sqWpc-0002uk-0l for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Sep 2024 13:57:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqWp7-00045C-Uk; Tue, 17 Sep 2024 07:56:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqWp5-00044w-MV for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 07:56:47 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqWp5-0003Y0-Aj for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 07:56:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=fjq3fwKMApQV7Oy4JuLOo5HzR/7KwatG5wUbTIaL59c=; b=IQUhVpF2ZO7aFp8S2IkNUUNu16XNnY9dy+VIsXR1Xqpszl511jcb4Iy3QmmtMht3k1744wHkTy3Tibk8+UfeV2n9TilkSTP6ZRDKAClvaEpu52+yI7MizGTOBYHS0WlJ1Kf6f3wHB9GIZfScwBG+V0+mEoBkpkvkexuzgF79ahliIIS2/jTA4GLjwjQKwFbRvIKecYM7mbtG77SUpWErdR5OYqcPN09DgZKvDYgiGzZ4hvDdq/Rr7QiGWLYowyf1IZbPo+BQisLWxZQ975hS2mJoyaRGYUz+smcU1Gm9/dG8Q190MJ52s1lcOgIIYMOHaV/SJFpxwqWcSMwO83viOg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqWpJ-0007y9-TX for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 07:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Klausner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Sep 2024 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73307 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73307-submit@debbugs.gnu.org id=B73307.172657421030610 (code B ref 73307); Tue, 17 Sep 2024 11:57:01 +0000 Original-Received: (at 73307) by debbugs.gnu.org; 17 Sep 2024 11:56:50 +0000 Original-Received: from localhost ([127.0.0.1]:54130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqWp8-0007xe-3T for submit@debbugs.gnu.org; Tue, 17 Sep 2024 07:56:50 -0400 Original-Received: from gatalith.at ([45.132.245.72]:52813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqWp6-0007xV-En for 73307@debbugs.gnu.org; Tue, 17 Sep 2024 07:56:48 -0400 Original-Received: by gatalith.at (Postfix, from userid 1000) id C09DB390CC5; Tue, 17 Sep 2024 13:56:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gatalith.at; s=dkim; t=1726574160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fjq3fwKMApQV7Oy4JuLOo5HzR/7KwatG5wUbTIaL59c=; b=lktEbTyRelk0k6q7vSiGwmAQ+VKDJMldJAuXFbGobtUn5O+0Un87HTOB/viG6aZiJXr7Zr f0OQ+7gDwQHw2iJuuh7xfIMcxibDkvpP7C8b1CmluMG6vIADRc1/pqZjTqfIFx9+clBPfi hPaV5MtEOpDRBv+lgBia7slYzc4nQFk= Content-Disposition: inline In-Reply-To: <86r09ibiq3.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291934 Archived-At: On Tue, Sep 17, 2024 at 02:52:20PM +0300, Eli Zaretskii wrote: > Thanks. However, I'm not sure this is the right fix, the function is > defined with argument type of 'int'. Paul, any comments? That is exactly the problem. If you pass a 'signed char' below -1, it gets converted to the same integer value, also a negative number below -1, and you end up passing an invalid argument to the function. The function is defined to only accept EOF and non-negative values in the range of 'unsigned char'. -1 is only special because that's usually the value of EOF. Thomas