mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gunixmounts: Fix a potential strcmp(NULL) call
mntent->mnt_fsname may be NULL at this point; if so, fall to the second branch and set mount_entry->device_path = NULL. Found by scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=113075
This commit is contained in:
@@ -418,7 +418,7 @@ _g_get_unix_mounts (void)
|
||||
|
||||
mount_entry = g_new0 (GUnixMountEntry, 1);
|
||||
mount_entry->mount_path = g_strdup (mntent->mnt_dir);
|
||||
if (strcmp (mntent->mnt_fsname, "/dev/root") == 0)
|
||||
if (g_strcmp0 (mntent->mnt_fsname, "/dev/root") == 0)
|
||||
mount_entry->device_path = g_strdup (_resolve_dev_root ());
|
||||
else
|
||||
mount_entry->device_path = g_strdup (mntent->mnt_fsname);
|
||||
|
Reference in New Issue
Block a user