[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [patch] string.match() recursion depth limit
- From: Peter Cawley <lua@...>
- Date: Sun, 8 Jul 2012 13:16:06 +0100
On Sun, Jul 8, 2012 at 1:02 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> Pattern matching in Lua uses recursion to implement several features.
>> The recursion depth is not limited, meaning that user code can cause
>> stack exhaustion and thus a segfault.
>
> Could you please post a minimal example that exhibits this problem?
[corsix@newman ~]$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> =("a"):rep(2^20):match((".?"):rep(2^20))
Segmentation fault