0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-03-13 01:40:09 +00:00

🐛 Fix multi-byte menu string buffer overrun (#27100)

This commit is contained in:
Scott Lahteine 2024-05-19 18:43:04 -05:00 committed by GitHub
parent a97d1088f0
commit eec1aec071
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -114,7 +114,7 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in
* Return the number of characters emitted
*/
lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) {
char estr[maxlen + 2];
char estr[maxlen * LANG_CHARSIZE + 2];
const lcd_uint_t outlen = expand_u8str_P(estr, ptpl, ind, cstr, fstr, maxlen);
lcd_put_u8str_max(estr, maxlen * (MENU_FONT_WIDTH));
return outlen;

View file

@ -1637,8 +1637,7 @@ void prepare_line_to_destination() {
SERIAL_ECHO_START();
msg.echoln();
msg.setf(GET_TEXT_F(MSG_HOME_FIRST), need);
ui.set_status(msg);
ui.status_printf(0, GET_TEXT_F(MSG_HOME_FIRST), need);
return true;
}