unofficial mirror of bug-gnu-emacs@gnu.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 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).