unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Kenichi Handa  <handa@m17n.org>
Cc: 1864@emacsbugs.donarmstrong.com,
	Wang Diancheng <dianchengwang@gmail.com>
Subject: bug#1864: 23.0.60; detect attached file coding system, make emacs crash.
Date: Tue, 13 Jan 2009 22:54:29 -0500	[thread overview]
Message-ID: <87priq8ruy.fsf@cyd.mit.edu> (raw)

> 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;






             reply	other threads:[~2009-01-14  3:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14  3:54 Chong Yidong [this message]
2009-01-14  8:44 ` bug#1864: 23.0.60; detect attached file coding system, make emacs crash Juanma Barranquero
  -- strict thread matches above, loose matches on Subject: below --
2009-01-12  2:51 Wang Diancheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87priq8ruy.fsf@cyd.mit.edu \
    --to=cyd@stupidchicken.com \
    --cc=1864@emacsbugs.donarmstrong.com \
    --cc=dianchengwang@gmail.com \
    --cc=handa@m17n.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).