Make sure that argument passed to strncmp is non-NULL
Hello!
g_file_info_get_content_type()
may return NULL
which unfortunately isn't documented. I've filed the issue for the same on GNOME gitlab https://gitlab.gnome.org/GNOME/glib/-/issues/2124
So such returned pointer should not be passed to strncmp()
without making sure that it's non-NULL.
But in src/image_list.c Line 766 we pass content_type
returned from g_file_info_get_content_type
directly to strncmp()
. I think we can fix this as:
- if (strncmp (content_type, "image/", 6) == 0)
+ if (content_type && (strncmp (content_type, "image/", 6) == 0))
I'm a long time XFCE user (4+ years) and always wanted to contribute. May I submit the MR for this issue?
Thanks!