From eaaf5ba90cb9efe62b9186c60f093f8b9390f260 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 31 Jan 2023 17:37:20 +0100 Subject: Fix crash in Zenity filechooser with badly formed filter (#665) --- src/Fl_Native_File_Chooser_Kdialog.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Fl_Native_File_Chooser_Kdialog.cxx b/src/Fl_Native_File_Chooser_Kdialog.cxx index a89a74abc..cab64b217 100644 --- a/src/Fl_Native_File_Chooser_Kdialog.cxx +++ b/src/Fl_Native_File_Chooser_Kdialog.cxx @@ -205,6 +205,7 @@ char *Fl_Kdialog_Native_File_Chooser_Driver::parse_filter(const char *f) { const char *r = strchr(f, '{'); char *developed = NULL; if (r) { // with {} + if (r <= p) return NULL; char *lead = new char[r-p]; memcpy(lead, p+1, (r-p)-1); lead[(r-p)-1] = 0; const char *r2 = strchr(r, '}'); -- cgit v1.2.3