Re: Bash regexp parsing would benefit from safe recursion limit

2022-04-08 Thread Dale R. Worley
willi1337 bald writes: > A deeply nested and incorrect regex expression can cause exhaustion of > stack resources, which crashes the bash process. Further, you could construct a deeply nested regex that is correct but would still crash the process. It's hard to define what should happen in a way

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-31 Thread Chet Ramey
On 3/30/22 7:48 PM, Steffen Nurpmeso wrote: Chet Ramey wrote in : |On 3/30/22 11:16 AM, willi1337 bald wrote: |> Bash Version: 5.1 |> Patch Level: 16 |> Release Status: release |> |> Description: |> |> A deeply nested and incorrect regex expression can cause exhaustion of |> s

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Steffen Nurpmeso
Chet Ramey wrote in : |On 3/30/22 11:16 AM, willi1337 bald wrote: |> Bash Version: 5.1 |> Patch Level: 16 |> Release Status: release |> |> Description: |> |> A deeply nested and incorrect regex expression can cause exhaustion of |> stack resources, which crashes the bash process. | |B

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Chet Ramey
On 3/30/22 11:16 AM, willi1337 bald wrote: > Bash Version: 5.1 > Patch Level: 16 > Release Status: release > > Description: > > A deeply nested and incorrect regex expression can cause exhaustion of > stack resources, which crashes the bash process. Bash doesn't use it's own regexp engine; it u

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Alex fxmbsw7 Ratchev
On Wed, Mar 30, 2022 at 7:47 PM Martin Schulte wrote: > Hello Willi! > > > Fix: > > Count the stack frames during recursive parsing and emit error before > stack > > resources are entirely consumed. > > What exactly should happen and what is the benefit of this solution? > i guess it wont segfau

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Martin Schulte
Hello Willi! > Fix: > Count the stack frames during recursive parsing and emit error before stack > resources are entirely consumed. What exactly should happen and what is the benefit of this solution? BTW: I tried trap 'echo "Ohohoh..."; exit 1;' SIGSEGV but the signal wasn't caught (which di