Skip to content

Commit

Permalink
correct bounds checking in Print::printf to avoid corner case of len=…
Browse files Browse the repository at this point in the history
…64 (#2204)
  • Loading branch information
atanisoft authored and me-no-dev committed Dec 16, 2018
1 parent 25fd2d0 commit 39836f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/esp32/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ size_t Print::printf(const char *format, ...)
len = vsnprintf(temp, len+1, format, arg);
write((uint8_t*)temp, len);
va_end(arg);
if(len > 64){
if(len >= sizeof(loc_buf)){
delete[] temp;
}
return len;
Expand Down

0 comments on commit 39836f1

Please sign in to comment.