mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 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
2583a66ee7
commit
0f85eefb8b
@ -780,7 +780,7 @@ g_content_type_guess (const gchar *filename,
|
|||||||
if (filename)
|
if (filename)
|
||||||
{
|
{
|
||||||
i = strlen (filename);
|
i = strlen (filename);
|
||||||
if (filename[i - 1] == '/')
|
if (i > 0 && filename[i - 1] == '/')
|
||||||
{
|
{
|
||||||
name_mimetypes[0] = "inode/directory";
|
name_mimetypes[0] = "inode/directory";
|
||||||
name_mimetypes[1] = NULL;
|
name_mimetypes[1] = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user