[master] 72901a6 - Fix potential buffer overrun (WIN32 only)

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 72901a6 - Fix potential buffer overrun (WIN32 only) "Albrecht Schlosser" 09:17 Apr 16 top right image
 
commit 72901a626c47502b3ab660b8a67ec82698ebe56d
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Fri Apr 16 18:08:15 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Fri Apr 16 18:08:15 2021 +0200

    Fix potential buffer overrun (WIN32 only)

 src/Fl_Native_File_Chooser_WIN32.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git src/Fl_Native_File_Chooser_WIN32.cxx src/Fl_Native_File_Chooser_WIN32.cxx
index 9a60f4c..1308e89 100644
--- src/Fl_Native_File_Chooser_WIN32.cxx
+++ 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);
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.