Fix potential buffer overflow in LCD messages

This commit is contained in:
Yuri D'Elia 2022-12-12 13:51:31 +01:00 committed by 3d-gussner
parent 6a3d82e492
commit d84231f2d5
1 changed files with 3 additions and 2 deletions

View File

@ -2789,7 +2789,8 @@ static bool autotune(int16_t cal_temp)
{
uint16_t samples;
float e;
char tm_message[20];
char tm_message[LCD_WIDTH+1];
// bootstrap C/R values without fan
set_fan_speed(0);
@ -2886,7 +2887,7 @@ static bool autotune(int16_t cal_temp)
void temp_model_autotune(int16_t temp, bool selftest)
{
char tm_message[20];
char tm_message[LCD_WIDTH+1];
if(moves_planned() || printer_active()) {
sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE"));
lcd_setstatus_serial(tm_message);