mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-27 04:02:02 +00:00
🐛 Fix multi-byte menu string buffer overrun (#27100)
This commit is contained in:
parent
a97d1088f0
commit
eec1aec071
2 changed files with 2 additions and 3 deletions
Marlin/src
|
@ -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
|
* 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*/) {
|
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);
|
const lcd_uint_t outlen = expand_u8str_P(estr, ptpl, ind, cstr, fstr, maxlen);
|
||||||
lcd_put_u8str_max(estr, maxlen * (MENU_FONT_WIDTH));
|
lcd_put_u8str_max(estr, maxlen * (MENU_FONT_WIDTH));
|
||||||
return outlen;
|
return outlen;
|
||||||
|
|
|
@ -1637,8 +1637,7 @@ void prepare_line_to_destination() {
|
||||||
SERIAL_ECHO_START();
|
SERIAL_ECHO_START();
|
||||||
msg.echoln();
|
msg.echoln();
|
||||||
|
|
||||||
msg.setf(GET_TEXT_F(MSG_HOME_FIRST), need);
|
ui.status_printf(0, GET_TEXT_F(MSG_HOME_FIRST), need);
|
||||||
ui.set_status(msg);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue