bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5526: 23.1; (master) - charset.c possible unwise use of alloca(3)


From: Vivek Dasmohapatra
Subject: bug#5526: 23.1; (master) - charset.c possible unwise use of alloca(3)
Date: Fri, 5 Feb 2010 02:55:12 +0000 (GMT)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

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?









reply via email to

[Prev in Thread] Current Thread [Next in Thread]