From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73985: fix: charset.max_char may be used before being set Date: Thu, 24 Oct 2024 17:12:13 +0300 Message-ID: <86plnpd1z6.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1383"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73985@debbugs.gnu.org To: altermo31 Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 24 16:13:03 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 1t3yaE-0000BA-KR for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Oct 2024 16:13:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3yZk-00076Z-W0; Thu, 24 Oct 2024 10:12:33 -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 1t3yZj-00076R-H7 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 10:12:31 -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 1t3yZj-0005FV-2f for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 10:12:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=oL/w3KSwNP60chTvyqxX7ooyFC91aISBrW7n8RLuTuI=; b=XfJfv0xfEBF55xnxomuHXBJUNmQxjhDTwE/5lfUJILeVk7nK3EPwOLWfDlWgp5hcqXjTnTYCaP6qZ3nrtZpnJMRPc5zsON+xr71fGJKzq5F29TmqygWdzcTGZiatFkmpn7YJWFxaw9XVupDQ2M9FOHyXWZW1CVnbJ/owfKi4WImHdetXf20OW0hbBLHtfiq44ifUaFxskgO8ylJ008p9MIQ11rDsjaI0nn0P2ygD2/sb7+6RO+5srCiMjfUfu9QNZhsCq2Ygl2i5iq6hqCCwdt4MJC69/ud409topfsG2dtG3wNKOObQQ+kloozPnyaVgLotlJnn4nMBXR7g7DbsJQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t3yaD-0006AW-Lu for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 10:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Oct 2024 14:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73985 X-GNU-PR-Package: emacs Original-Received: via spool by 73985-submit@debbugs.gnu.org id=B73985.172977917623693 (code B ref 73985); Thu, 24 Oct 2024 14:13:01 +0000 Original-Received: (at 73985) by debbugs.gnu.org; 24 Oct 2024 14:12:56 +0000 Original-Received: from localhost ([127.0.0.1]:35803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3ya8-0006A5-8s for submit@debbugs.gnu.org; Thu, 24 Oct 2024 10:12:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3ya6-00069o-MM for 73985@debbugs.gnu.org; Thu, 24 Oct 2024 10:12:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3yZU-0005E2-Vi; Thu, 24 Oct 2024 10:12:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oL/w3KSwNP60chTvyqxX7ooyFC91aISBrW7n8RLuTuI=; b=l8E7X9gGsBE/ WgBI/KDqSZSzI5A4rYM7rxiqaRf/VZR/MmJW1RYBxScYnr2GMiwP7WVJeN7RWx8qix6uHLjXMG7mx nG400N5B/A3y0g1EQOTfh0dQR1JIaIUl7jenLn237wKBZEUgDG+t76yTp6rKiXUhqdg8Px7p14NhZ nAd1c+DjhLa8ip9GGpLLc3YvVkyQINTEyHYZNi1xI/N23UULXxmjdzER3d9ATlZB7iKc3OM5j+p4S dUN9cWV9+Dlqoz/Vo2eFomogZwMm5TKhnyAjSufHN0flvO1RAjrRpDXTNiZ6eY+e/tvnWnObgaa2V QnTkzy51ImK2njrHPPW11g==; In-Reply-To: (bug-gnu-emacs@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:294191 Archived-At: > Date: Thu, 24 Oct 2024 11:46:17 +0000 > From: altermo31 via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Problem: > If the value to be set to charset.max_char is invalid, an error occurs, but the error uses the yet unset charset.max_char. > > Solution: > Use the value that charset.max_char would be set to if the value wasn't invalid. Thanks. You are right that the original code is incorrect, but the code you propose has a subtle problem: the sum i + charset.code_offset could overflow. So we need to find a safer way of explaining the problem.