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:
@@ -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"));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user