Fix potential buffer overrun (WIN32 only)

This commit is contained in:
Albrecht Schlosser 2021-04-16 18:08:15 +02:00
parent cacaa17499
commit 72901a626c
1 changed files with 1 additions and 1 deletions

View File

@ -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);