Skip to content

Commit d36912a

Browse files
Address review comments
1 parent 45e8e90 commit d36912a

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

Lib/test/test_traceback.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -625,18 +625,6 @@ def test_signatures(self):
625625
str(inspect.signature(traceback.format_exception_only)),
626626
'(exc, /, value=<implicit>, *, show_group=False, **kwargs)')
627627

628-
def test_traceback_deep_recursion_alloca(self):
629-
630-
def recurse(n):
631-
if n == 0:
632-
raise RuntimeError("boom")
633-
return recurse(n - 1)
634-
try:
635-
recurse(50)
636-
except RuntimeError as exc:
637-
tb = traceback.format_exception(exc)
638-
assert any("RuntimeError" in line for line in tb)
639-
640628

641629
class PurePythonExceptionFormattingMixin:
642630
def get_exception(self, callable, slice_start=0, slice_end=-1):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Fix incorrect memory allocation in the VLA fallback macro in traceback.c
2-
when using alloca(), preventing potential out-of-bounds access.
1+
Fix out-of-bounds access when invoking faulthandler on a CPython build
2+
compiled without support for VLAs.

Python/traceback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#if defined(__STDC_NO_VLA__) && (__STDC_NO_VLA__ == 1)
4343
/* Use alloca() for VLAs. */
44-
# define VLA(type, name, size) type *name = (type *)alloca(sizeof(type) * (size))
44+
# define VLA(type, name, size) type *name = alloca(sizeof(type) * (size))
4545
#elif !defined(__STDC_NO_VLA__) || (__STDC_NO_VLA__ == 0)
4646
/* Use actual C VLAs.*/
4747
# define VLA(type, name, size) type name[size]

0 commit comments

Comments
 (0)