Re: [PATCH] parser: preserve characters on heap in backquote parsing

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

 



Ron Yorston <rmy@xxxxxxxxxxxx> wrote:
> This bug report for BusyBox ash also applies to dash:
> 
>   https://bugs.busybox.net/show_bug.cgi?id=9246
> 
> With an 8MB stack the test case results in a segfault.
> 
> Instead of using alloca() to preserve characters keep them on the
> memalloc stack.  With this change the test case returns:
> 
>   $ dash test_case
>   test_case: 3141: test_case: Syntax error: Unterminated quoted string
> 
> If the heap is reduced to the same size as the stack, 8MB:
> 
>   $ ulimit -S -d 8192
>   $ dash test_case
>   test_case: 0: test_case: Out of space
> 
> Signed-off-by: Ron Yorston <rmy@xxxxxxxxx>

Sorry, but this is not the only place where dash relies on alloca.
So you're bound to run into this problem again if you have a script
that attempts to push dash to use more than 8MB in places like this.

So I'm not going to accept this patch as alloca makes things a lot
simpler in some cases.

Thanks,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux