Hi, Issue found by Coverity Scan. CID 210637 (#2 of 2): Dereference null return value (NULL_RETURNS) dereference: Dereferencing a null pointer cb.
--- a\src\gtk\iupgtk_filedlg.c Fri Jun 09 13:26:00 2017
+++ b\src\gtk\iupgtk_filedlg.c Thu Jan 18 15:42:06 2018
@@ -234,13 +234,16 @@
/* callback here always exists */
IFnss cb = (IFnss)IupGetCallback(ih, "FILE_CB");
- if (gtkIsFile(filename))
- cb(ih, iupgtkStrConvertFromFilename(filename), "SELECT");
- else
- cb(ih, iupgtkStrConvertFromFilename(filename), "OTHER");
-
- g_free (filename);
+ /* Prevent Application error */
+ if (cb)
+ {
+ if (gtkIsFile(filename))
+ cb(ih, iupgtkStrConvertFromFilename(filename), "SELECT");
+ else
+ cb(ih, iupgtkStrConvertFromFilename(filename), "OTHER");
+ }
+ g_free(filename);
gtk_file_chooser_set_preview_widget_active(file_chooser, TRUE);
}
Best.
Ranier
iupgtk_filedlg.patch
Description: iupgtk_filedlg.patch
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Iup-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/iup-users
