tweaks: defend against hypothetical format specifiers

With this change, any format specifiers that the now third parameter
of statusline() *might* contain will not lead to unintended accesses
of memory.

Suggested-by: Jonathan Echavarria <jrec93@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This commit is contained in:
Benno Schulenberg
2026-04-02 11:14:30 +02:00
parent 0b7328bce4
commit c1ea0601c9
2 changed files with 2 additions and 2 deletions

View File

@@ -781,7 +781,7 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable)
/* If there was a real error during the reading, let the user know. */
if (ferror(f) && errornumber != EINTR && errornumber != 0)
statusline(ALERT, strerror(errornumber));
statusline(ALERT, "%s", strerror(errornumber));
if (control_C_was_pressed)
statusline(ALERT, _("Interrupted"));

View File

@@ -2421,7 +2421,7 @@ void statusbar(const char *msg)
void warn_and_briefly_pause(const char *msg)
{
blank_bottombars();
statusline(ALERT, msg);
statusline(ALERT, "%s", msg);
lastmessage = VACUUM;
napms(1500);
}