all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Kenichi Handa  <handa@m17n.org>
Cc: Ted Zlatanov <tzz@lifelogs.com>, 1380@emacsbugs.donarmstrong.com
Subject: bug#1380: 23.0.60; file content causes CVS emacs to crash
Date: Thu, 20 Nov 2008 02:36:31 -0500	[thread overview]
Message-ID: <87myfuhmrk.fsf@cyd.mit.edu> (raw)

> The file content in a file causes Emacs to crash as soon as it's
> opened.  Tested with "emacs -q file".

Looks like the charbuf in the coding structure is overflowing.  The
following rough patch prevents this overflow and the crash, but maybe
there is a deeper bug.  The comments in coding.c:6610 says "We are sure
that the number of data is less than the size of coding->charbuf."  This
bug comes about due to that faile assumption.

Handa-san, what do you think?

*** trunk/src/coding.c.~1.394.~	2008-10-24 00:06:43.000000000 -0400
--- trunk/src/coding.c	2008-11-20 02:29:02.000000000 -0500
***************
*** 6617,6622 ****
--- 6617,6633 ----
  
  	      if (c & 0x80)
  		c = BYTE8_TO_CHAR (c);
+ 
+ 	      if (coding->charbuf_used >= coding->charbuf_size)
+ 		{
+ 		  int *old_charbuf = coding->charbuf;
+ 
+ 		  coding->charbuf_size *= 2;
+ 		  coding->charbuf = (int *) alloca (sizeof (int)
+ 						    * coding->charbuf_size);
+ 		  bcopy (old_charbuf, coding->charbuf, coding->charbuf_size);
+ 		}
+ 
  	      coding->charbuf[coding->charbuf_used++] = c;
  	    }
  	  produce_chars (coding, Qnil, 1);






             reply	other threads:[~2008-11-20  7:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  7:36 Chong Yidong [this message]
2008-11-21  2:25 ` bug#1380: 23.0.60; file content causes CVS emacs to crash Kenichi Handa
     [not found] ` <mailman.909.1227235818.26697.bug-gnu-emacs@gnu.org>
2008-11-21 18:41   ` Ted Zlatanov
2008-11-26 15:32     ` Ted Zlatanov
  -- strict thread matches above, loose matches on Subject: below --
2008-11-19 16:06 Ted Zlatanov

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

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

  git send-email \
    --in-reply-to=87myfuhmrk.fsf@cyd.mit.edu \
    --to=cyd@stupidchicken.com \
    --cc=1380@emacsbugs.donarmstrong.com \
    --cc=handa@m17n.org \
    --cc=tzz@lifelogs.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.