Skip to content

Commit b4ff08d

Browse files
committed
Prohibit too big a size
1 parent d7e6a78 commit b4ff08d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ STATIC supervisor_allocation *allocate_pystack(safe_mode_t safe_mode) {
142142
(void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size);
143143
// Check if value is valid
144144
pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4.
145-
if (pystack_size < 384) {
145+
if ((pystack_size < 384) || (pystack_size > 900000)) {
146146
serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r"));
147147
pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset
148148
}

0 commit comments

Comments
 (0)