[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

[MD:1464]A solution for "Bitmap kills emacs" problem.



ふう、やっとバグを取り終えた。テストバイナリもしばらく後におきます。
これは、前のswitch-frameの修正も含みます。

YAMAGUCHI Shuhei <yamagus@xxxxxxxxxxxxxxxxxxxxxxx> writes:

> >>>>> In [meadow-develop : No.1459] 
> >>>>>	YAMAGUCHI Shuhei <yamagus@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> や> #持ってない方が試せるように…ということで。 ^^;
> 
> 小関> これって C-x C-f (find-file) しただけで落ちるんですか?
> 
> 小関> それとも (mew-hello) を実行すると落るんですか?
> 
> 山口> M-x mew (mew-hello) しか試してなかったんで、試してみました。
> 山口> #そっか、(mew-hello) だけで落ちるんであれば、ML にイメージファイルを送
> 山口> #るのは意味無しですね。 ^^;
> 
> 山口> 普段通りに起動して C-x C-f でも落ちます。

やっぱりテストしてくれる人たちはありがたいです。

で、半田さん、str_cmpchar_id()がreallocationから身を守るためのパッチです。

from himi

1999-09-19  Miyashita Hisashi  <himi@xxxxxxxxxxxxxxxxxxxxxxxxx>

	* charset.c (str_cmpchar_id): 
	Before xmalloc(), copy str to buf where is safe against
	memory realocation caused by r_alloc.  From now then,
	copy the data to cmpcharp->data.

*** charset.c	Sun Sep 19 13:08:30 1999
--- charset.c.new	Sun Sep 19 13:07:19 1999
***************
*** 1557,1562 ****
--- 1557,1570 ----
    if (!registerp)
      return -1;
  
+   /* First we must str to safty memory that is alloced by alloca()
+      because str would be made invalid by reallocation caused
+      by succeeding xmalloc()s when str points r_alloced memory,
+      which is usually buffer memory.
+      From now on, we must not trust str. */
+   buf = (unsigned char*) alloca(sizeof(unsigned char) * len);
+   bcopy (str, buf, len);
+ 
    /* We have to register the composite character in cmpchar_table.  */
    if (n_cmpchars >= (CHAR_FIELD2_MASK | CHAR_FIELD3_MASK))
      /* No, we have no more room for a new composite character.  */
***************
*** 1603,1609 ****
  
    cmpcharp->len = len;
    cmpcharp->data = (unsigned char *) xmalloc (len + 1);
!   bcopy (str, cmpcharp->data, len);
    cmpcharp->data[len] = 0;
    cmpcharp->glyph_len = chars;
    cmpcharp->glyph = (GLYPH *) xmalloc (sizeof (GLYPH) * chars);
--- 1611,1617 ----
  
    cmpcharp->len = len;
    cmpcharp->data = (unsigned char *) xmalloc (len + 1);
!   bcopy (buf, cmpcharp->data, len);
    cmpcharp->data[len] = 0;
    cmpcharp->glyph_len = chars;
    cmpcharp->glyph = (GLYPH *) xmalloc (sizeof (GLYPH) * chars);