Fix crash in Zenity filechooser with badly formed filter (#665)

This commit is contained in:
ManoloFLTK 2023-01-31 17:37:20 +01:00
parent 8ef592db1e
commit eaaf5ba90c

View File

@ -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, '}');