Closed
Description
Permalink to impacted code region:
arduino-esp32/cores/esp32/Print.cpp
Line 66 in 278fa0d
In the code for Print::printf()
, when printing text that would result in a length that would exceed the size of the local buffer (>= 64), a new buffer will be heap-allocated. However, the check at the end of the function is not correct. When the number of characters that would be printed is exactly 64, then a buffer of 65 bytes will be allocated. However, the check at the end will fail (as len will be 64 which is not greater than 64), causing this buffer to be leaked.
I'd recommend changing this check to be as follows:
if(temp != loc_buf) {
delete[] temp;
}
Metadata
Metadata
Assignees
Labels
No labels