From: Paul Eggert Date: Mon, 24 Oct 2011 23:06:11 +0000 (-0700) Subject: *print.c (Fexternal_debugging_output): Use more-conservative overflow fix. X-Git-Tag: emacs-24.2.90~471^2~6^2~140 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0fd11aa5e26da5ee2b36996f1a2376fb2d7ec6cc;p=emacs.git *print.c (Fexternal_debugging_output): Use more-conservative overflow fix. --- diff --git a/src/ChangeLog b/src/ChangeLog index c288ed6a2ed..5b41db9831a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -554,8 +554,7 @@ Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts. (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough. (printchar, strout): Use xpalloc to catch size calculation overflow. - (Fexternal_debugging_output): Use CHECK_CHARACTER, not CHECK_NUMBER, - to avoid mishandling large integers. + (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion. (print_error_message): Use SAFE_ALLOCA, not alloca. (print_object): Use int, not EMACS_INT, where int is wide enough. * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT. diff --git a/src/print.c b/src/print.c index 63ef3e6279e..f3302daaea3 100644 --- a/src/print.c +++ b/src/print.c @@ -716,8 +716,8 @@ You can call print while debugging emacs, and pass it this function to make it write to the debugging output. */) (Lisp_Object character) { - CHECK_CHARACTER (character); - putc ((int) XINT (character), stderr); + CHECK_NUMBER (character); + putc (XINT (character) & 0xFF, stderr); #ifdef WINDOWSNT /* Send the output to a debugger (nothing happens if there isn't one). */