GNU bug report logs - #1864
23.0.60; detect attached file coding system, make emacs crash.

Previous Next

Package: emacs;

Reported by: Wang Diancheng <dianchengwang <at> gmail.com>

Date: Mon, 12 Jan 2009 03:00:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 1864 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kenichi Handa  <handa <at> m17n.org>
Cc: Wang Diancheng <dianchengwang <at> gmail.com>, 1864 <at> debbugs.gnu.org
Subject: Re: 23.0.60; detect attached file coding system, make emacs crash.
Date: Tue, 13 Jan 2009 22:54:29 -0500
> detect attached file coding system with following code, make emacs crash
>
> (with-temp-buffer
>     (insert-file-contents "/home/dcwang/1.txt")
>     (detect-coding-region (point-min) (point-max) t))

Looks like detect_coding_utf_16 forgets to check for negative values of
ONE_MORE_BYTE.  Handa-san, could you check the following patch?

*** trunk/src/coding.c.~1.406.~	2009-01-11 08:23:34.000000000 -0500
--- trunk/src/coding.c	2009-01-13 22:54:10.000000000 -0500
***************
*** 1612,1617 ****
--- 1612,1621 ----
  	{
  	  ONE_MORE_BYTE (c1);
  	  ONE_MORE_BYTE (c2);
+ 
+ 	  if (c1 < 0 || c2 < 0)
+ 	    break;
+ 
  	  if (! e[c1])
  	    {
  	      e[c1] = 1;




This bug report was last modified 16 years and 133 days ago.

Previous Next


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