arduino / arduino/ArduinoCore-sam

_sbrk has no bounds checking

Open
#138 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
91
Forks
112
PR merge metrics
No merged PRs in 30d

Description

_sbrk() in syscalls_sam3.c, does not contain any checks to see if the code is trying to acquired non-existent memory. This can lead malloc() and thus new to return pointers to either non-existent memory, or memory that belongs to the stack.

See https://forum.arduino.cc/t/ungraceful-handling-of-heap-depletion/1023509

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in syscalls_sam3.c at _sbrk() and trace how malloc() and new obtain memory on the SAM3 platform. Reproduce heap exhaustion if possible, then verify that requests cannot return pointers to nonexistent memory or the stack.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.