This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR binutils/14526: c++filt is crashed on large files


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]