This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR binutils/14526: c++filt is crashed on large files
- From: Ian Lance Taylor <iant at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Aug 2012 17:09:10 -0700
- Subject: Re: PATCH: PR binutils/14526: c++filt is crashed on large files
- References: <20120828183347.GA5331@intel.com>
On Tue, Aug 28, 2012 at 11:33 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>
> buildargv uses alloca to allocate buffer, whose size may exceed stack
> limit. This patch replaces alloca with xmalloc/free. OK to install?
>
> Thanks.
>
> H.J.
> ---
> PR binutils/14526
> * argv.c (buildargv): Replace alloca with xmalloc/free.
This is OK.
Thanks.
Consider also replacing strdup with xstrdup. And there are other
malloc calls that could become xmalloc. I can't think of any way that
this code would be used where it needs to degrade gracefully when
short on memory.
Ian