[glib: 1/2] gfileinfo: Add missing preconditions to g_file_info_get_attribute_data()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] gfileinfo: Add missing preconditions to g_file_info_get_attribute_data()
- Date: Mon, 14 Dec 2020 17:42:56 +0000 (UTC)
commit f49831ccb42170db78644e19b4ac5aa56eddb91a
Author: oucaijun <oucaijun uniontech com>
Date: Mon Dec 14 09:41:00 2020 +0800
gfileinfo: Add missing preconditions to g_file_info_get_attribute_data()
gio/gfileinfo.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c
index 1b008f79a..1fba1139e 100644
--- a/gio/gfileinfo.c
+++ b/gio/gfileinfo.c
@@ -734,6 +734,9 @@ g_file_info_get_attribute_data (GFileInfo *info,
{
GFileAttributeValue *value;
+ g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE);
+ g_return_val_if_fail (attribute != NULL && *attribute != '\0', FALSE);
+
value = g_file_info_find_value_by_name (info, attribute);
if (value == NULL)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]