Actions
Bug #9608
closed[PATCH] avoid large alloca on Complex/Rational calls
Description
- complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
- rational.c (read_digits): ditto
This fixes segfaults on:
Rational("1" * 16 * 1024 * 1024)
Complex("1" * 16 * 1024 * 1024)
On my system where my stack size is only 8M.
tadf: Should we raise an exception on large string instead?
Large strings are slow to parse and could still be a DoS.
Files
Updated by normalperson (Eric Wong) about 10 years ago
tadf: ping?
Updated by tadf (tadayoshi funaba) about 10 years ago
i'd like to try it; please commit it.
Updated by Anonymous about 10 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r45793.
avoid large alloca on Complex/Rational calls
- complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
[Bug #9608] - rational.c (read_digits): ditto
Updated by usa (Usaku NAKAMURA) almost 10 years ago
- Backport changed from 1.9.3: UNKNOWN, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: UNKNOWN, 2.0.0: DONE, 2.1: REQUIRED
backported into ruby_2_0_0
at r46578.
Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago
- Backport changed from 1.9.3: UNKNOWN, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: UNKNOWN, 2.0.0: DONE, 2.1: DONE
Backported into ruby_2_1
at r46612.
Actions
Like0
Like0Like0Like0Like0Like0Like0