Skip to content

Commit d9c2667

Browse files
[3.14] gh-145792: Fix incorrect alloca allocation size in traceback.c (GH-145814) (#145909)
gh-145792: Fix incorrect alloca allocation size in traceback.c (GH-145814) (cherry picked from commit 59d9768) Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
1 parent 4856992 commit d9c2667

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
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
@@ -42,7 +42,7 @@
4242

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

0 commit comments

Comments
 (0)