mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
gdesktopappinfo: Add checks for empty argv
There shouldn’t be any issues here with empty argv arrays since an empty `Exec=` line is already checked for. Encode that explicitly with an assertion. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
3ea4ba31a1
commit
11654811ef
@ -1880,6 +1880,10 @@ g_desktop_app_info_load_from_keyfile (GDesktopAppInfo *info,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
|
/* Since @exec is not an empty string, there must be at least one
|
||||||
|
* argument, so dereferencing argv[0] should return non-NULL. */
|
||||||
|
g_assert (argc > 0);
|
||||||
t = g_find_program_in_path (argv[0]);
|
t = g_find_program_in_path (argv[0]);
|
||||||
g_strfreev (argv);
|
g_strfreev (argv);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user