mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gio: fix OOB string access if filename is empty
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
d286ea0c57
commit
9f2660fbae
@ -780,7 +780,7 @@ g_content_type_guess (const gchar *filename,
|
||||
if (filename)
|
||||
{
|
||||
i = strlen (filename);
|
||||
if (filename[i - 1] == '/')
|
||||
if (i > 0 && filename[i - 1] == '/')
|
||||
{
|
||||
name_mimetypes[0] = "inode/directory";
|
||||
name_mimetypes[1] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user