Skip to content

Commit 39836f1

Browse files
atanisoftme-no-dev
authored andcommitted
correct bounds checking in Print::printf to avoid corner case of len=64 (#2204)
1 parent 25fd2d0 commit 39836f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp32/Print.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ size_t Print::printf(const char *format, ...)
6363
len = vsnprintf(temp, len+1, format, arg);
6464
write((uint8_t*)temp, len);
6565
va_end(arg);
66-
if(len >64){
66+
if(len >= sizeof(loc_buf)){
6767
delete[] temp;
6868
}
6969
return len;

0 commit comments

Comments
 (0)
close