GNU bug report logs - #73985
fix: charset.max_char may be used before being set

Previous Next

Package: emacs;

Reported by: altermo31 <altermo31 <at> proton.me>

Date: Thu, 24 Oct 2024 13:03:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: altermo31 <altermo31 <at> proton.me>
Cc: 73985 <at> debbugs.gnu.org
Subject: bug#73985: fix: charset.max_char may be used before being set
Date: Thu, 24 Oct 2024 17:12:13 +0300
> Date: Thu, 24 Oct 2024 11:46:17 +0000
> From:  altermo31 via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 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.




This bug report was last modified 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.