From 312f42ee34f179ba7ce3581175c6a4deeb0f3024 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Wed, 6 Mar 2024 18:25:15 +0100 Subject: [PATCH] glocalfileinfo: Use stat results only if stat succeeded --- gio/glocalfileinfo.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index e106465c4..097b72323 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -2058,11 +2058,14 @@ _g_local_file_info_get (const char *basename, (attributes & FILE_ATTRIBUTE_SYSTEM)); } - _g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_IS_MOUNTPOINT, - (statbuf.reparse_tag == IO_REPARSE_TAG_MOUNT_POINT)); + if (stat_ok) + { + _g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_IS_MOUNTPOINT, + (statbuf.reparse_tag == IO_REPARSE_TAG_MOUNT_POINT)); - if (statbuf.reparse_tag != 0) - _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_REPARSE_POINT_TAG, statbuf.reparse_tag); + if (statbuf.reparse_tag != 0) + _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_REPARSE_POINT_TAG, statbuf.reparse_tag); + } #endif symlink_target = NULL;