emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Segfault in Emacs 23 when attempting to insert a negative integer (w


From: Kenichi Handa
Subject: Re: Segfault in Emacs 23 when attempting to insert a negative integer (was: Re: infloop in skeleton-insert)
Date: Wed, 11 Apr 2007 21:08:12 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.95 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Lawrence Mitchell <address@hidden> writes:

> M-: (insert -1) RET

> resulting in a segmentation fault.  The problem appears to lie in
> the code-path to char_string(), the code does not seem to check to see
> if the "character" to be inserted is valid: specifically, negative
> arguments cause the stack to overflow (I think).

> char_string(c, p) calls CHAR_STRING(c, p), which, since c is negative,
> calls char_string(c, p) as a fallback.

> I'm not sure how to go about fixing this, the naive approach of
> calling CHECK_CHARACTER at the beginning of char_string results in a
> segfault when building.

Thank you for finding this bug.

I changed INTEGERP to CHARACTERP in general_insert_function.

> If called with a negative number as an argument, functions such as
> insert, char-to-string, and so forth will cause Emacs 23 to segfault
> in char_string().

I changed CHECK_NUMBER to CHECK_CHARACTER in Fchar_to_string.

---
Kenichi Handa
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]