all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vivek Dasmohapatra <vivek@etla.org>
To: 5526@debbugs.gnu.org
Subject: bug#5526: 23.1; (master) - charset.c possible unwise use of alloca(3)
Date: Fri, 5 Feb 2010 02:55:12 +0000 (GMT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1002050204590.1278@octopus.pepperfish.net> (raw)

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	other threads:[~2010-02-05  2:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  2:55 Vivek Dasmohapatra [this message]
2010-02-05  4:15 ` bug#5526: 23.1; (master) - charset.c possible unwise use of alloca(3) Chong Yidong
2010-02-05 14:05   ` Vivek Dasmohapatra
2010-02-06 13:27     ` Chong Yidong
2010-02-06 18:08       ` Vivek Dasmohapatra

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=alpine.DEB.2.00.1002050204590.1278@octopus.pepperfish.net \
    --to=vivek@etla.org \
    --cc=5526@debbugs.gnu.org \
    /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.