A flaw was found in newlib in versions prior to 4.0.0. Improper overflow validation in the memory allocation functions mEMALIGn, pvALLOc, nano_memalign, nano_valloc, nano_pvalloc could case an integer overflow, leading to an allocation of a small buffer and then to a heap-based buffer overflow.
https://www.cisa.gov/news-events/ics-advisories/icsa-21-119-04
https://www.tenable.com/cyber-exposure/2021-threat-landscape-retrospective