mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
Remove function pointer casts when calling xdg_run_command_on_dirs().
The function pointer casts silence the compiler and allow the code to build (and even run in the typical case). However, when building with control flow integrity checks, the runtime (rightfully) complains about calling a function via a mismatched function pointer type.
This commit is contained in:
parent
38869ece24
commit
2f98cbe483
@ -138,7 +138,8 @@ xdg_dir_time_list_free (XdgDirTimeList *list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xdg_mime_init_from_directory (const char *directory)
|
xdg_mime_init_from_directory (const char *directory,
|
||||||
|
void *user_data)
|
||||||
{
|
{
|
||||||
char *file_name;
|
char *file_name;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -404,10 +405,11 @@ xdg_check_file (const char *file_path,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
xdg_check_dir (const char *directory,
|
xdg_check_dir (const char *directory,
|
||||||
int *invalid_dir_list)
|
void *user_data)
|
||||||
{
|
{
|
||||||
int invalid, exists;
|
int invalid, exists;
|
||||||
char *file_name;
|
char *file_name;
|
||||||
|
int* invalid_dir_list = user_data;
|
||||||
|
|
||||||
assert (directory != NULL);
|
assert (directory != NULL);
|
||||||
|
|
||||||
@ -462,8 +464,7 @@ xdg_check_dirs (void)
|
|||||||
for (list = dir_time_list; list; list = list->next)
|
for (list = dir_time_list; list; list = list->next)
|
||||||
list->checked = XDG_CHECKED_UNCHECKED;
|
list->checked = XDG_CHECKED_UNCHECKED;
|
||||||
|
|
||||||
xdg_run_command_on_dirs ((XdgDirectoryFunc) xdg_check_dir,
|
xdg_run_command_on_dirs (xdg_check_dir, &invalid_dir_list);
|
||||||
&invalid_dir_list);
|
|
||||||
|
|
||||||
if (invalid_dir_list)
|
if (invalid_dir_list)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -519,8 +520,7 @@ xdg_mime_init (void)
|
|||||||
icon_list = _xdg_mime_icon_list_new ();
|
icon_list = _xdg_mime_icon_list_new ();
|
||||||
generic_icon_list = _xdg_mime_icon_list_new ();
|
generic_icon_list = _xdg_mime_icon_list_new ();
|
||||||
|
|
||||||
xdg_run_command_on_dirs ((XdgDirectoryFunc) xdg_mime_init_from_directory,
|
xdg_run_command_on_dirs (xdg_mime_init_from_directory, NULL);
|
||||||
NULL);
|
|
||||||
|
|
||||||
need_reread = FALSE;
|
need_reread = FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user