代码拉取完成,页面将自动刷新
From 32a3ec7e47243ea2c2530445df83f60f992f0c23 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Mon, 6 Nov 2023 18:38:34 +0100
Subject: [PATCH] part: Fix potential double free when getting parttype
fdisk_partition_get_type returns a pointer to a static table so
we shouldn't free it. fdisk_unref_parttype should against this but
we see some double free crashes that could be caused by this.
Related: https://github.com/storaged-project/udisks/issues/1208
---
src/plugins/part.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/plugins/part.c b/src/plugins/part.c
index 46d31137..20bb3628 100644
--- a/src/plugins/part.c
+++ b/src/plugins/part.c
@@ -462,7 +462,6 @@ static gchar* get_part_type_guid_and_gpt_flags (const gchar *device, int part_nu
if (!ptype_string) {
g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,
"Failed to get partition type for partition %d on device '%s'", part_num, device);
- fdisk_unref_parttype (ptype);
fdisk_unref_partition (pa);
close_context (cxt);
return NULL;
@@ -470,7 +469,6 @@ static gchar* get_part_type_guid_and_gpt_flags (const gchar *device, int part_nu
ret = g_strdup (ptype_string);
- fdisk_unref_parttype (ptype);
fdisk_unref_partition (pa);
close_context (cxt);
return ret;
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。