From 72901a626c47502b3ab660b8a67ec82698ebe56d Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 16 Apr 2021 18:08:15 +0200 Subject: [PATCH] Fix potential buffer overrun (WIN32 only) --- src/Fl_Native_File_Chooser_WIN32.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fl_Native_File_Chooser_WIN32.cxx b/src/Fl_Native_File_Chooser_WIN32.cxx index 9a60f4c19..1308e8976 100644 --- a/src/Fl_Native_File_Chooser_WIN32.cxx +++ b/src/Fl_Native_File_Chooser_WIN32.cxx @@ -794,7 +794,7 @@ void Fl_WinAPI_Native_File_Chooser_Driver::add_filter(const char *name_in, if ((strlen(name_in)+strlen(winfilter)+3) < sizeof(name)) { sprintf(name, "%s (%s)", name_in, winfilter); } else { - sprintf(name, "%.*s", int(sizeof(name)), name_in); + sprintf(name, "%.*s", int(sizeof(name))-1, name_in); } } dnullcat(_parsedfilt, name);