[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
Re: [Bug-cpio] [PATCH] lib/paxnames.c: Do not use alloca to avoid stack overflow
Thu, 23 Aug 2007 14:44:10 +0200
2007/8/23, Dmitry V. Levin <address@hidden>:
> On Tue, Aug 21, 2007 at 02:11:12PM +0200, Ladislav Michnovic wrote:
> >It was not used before cpio version 2.7. Am I right?
> The safer_name_suffix() function is part of paxlib (code shared between
> GNU cpio and GNU tar); was introduced approx. in tar-1.13.26 and later
> used in cpio-2.7 via paxlib.
Thank you for clarification. As I go through patches, I think your
uses alloca. So may be affected too.
Quoting your patch:
+ if (prefix_len)
+ char *prefix = alloca (prefix_len + 1);
+ memcpy (prefix, file_name, prefix_len);
+ prefix[prefix_len] = '\0';
Re: [Bug-cpio] [PATCH] lib/paxnames.c: Do not use alloca to avoid stack overflow, Sergey Poznyakoff, 2007/08/17