bug-cpio
[Top][All Lists]
Advanced

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

Re: [Bug-cpio] [PATCH] lib/paxnames.c: Do not use alloca to avoid stack


From: Dmitry V. Levin
Subject: Re: [Bug-cpio] [PATCH] lib/paxnames.c: Do not use alloca to avoid stack overflow
Date: Fri, 17 Aug 2007 15:10:21 +0400

On Fri, Aug 17, 2007 at 02:05:28PM +0300, Sergey Poznyakoff wrote:
> Dmitry V. Levin ha escrit:
> 
> > My suggestion is to avoid using alloca() with user controllable size.
> > In this particular case, memcpy() call could be optimized out as well.
> 
> The proposed patch will make things worse: tar will segfault, because
> the passed string is freed after inserting it in the hash table.

Sergey, have you looked at the patch?
I do not suggest to remove xstrdup completely, just replace it with
xmalloc; nothing more, nothing less.


-- 
ldv

Attachment: pgpiwphJxYxiq.pgp
Description: PGP signature


reply via email to

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