all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#5526: 23.1; (master) - charset.c possible unwise use of alloca(3)
@ 2010-02-05  2:55 Vivek Dasmohapatra
  2010-02-05  4:15 ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Vivek Dasmohapatra @ 2010-02-05  2:55 UTC (permalink / raw)
  To: 5526

In src/charset.c, in load_charset_map_from_file (and .._vector)
alloca is used to allocate sizeof (struct charset_map_entries) bytes:
which is 786436 bytes - this segfaults while building in a qemu-armel
scratchbox (alloca does not return an error, so its return value cannot
be checked).

In any case, this is more than MAX_ALLOCA, and can occur several times
in a while(1) loop in the same function: I've replaced the alloca with
calloc()/walk-the-linked-list-and-free() and the build seems much happier
so far - would you be interested in a patch?









^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-06 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-05  2:55 bug#5526: 23.1; (master) - charset.c possible unwise use of alloca(3) Vivek Dasmohapatra
2010-02-05  4:15 ` Chong Yidong
2010-02-05 14:05   ` Vivek Dasmohapatra
2010-02-06 13:27     ` Chong Yidong
2010-02-06 18:08       ` Vivek Dasmohapatra

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.