shim/shim-fix-fallback-double-free.patch
Gary Ching-Pang Lin 5263d48333 Accepting request 518613 from home:gary_lin:branches:devel:openSUSE:Factory
- Add upstream fixes
- Remove the stderr mask while compiling MokManager.efi since the warnings in Cryptlib were fixed.

OBS-URL: https://build.opensuse.org/request/show/518613
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=131
2017-08-25 03:47:51 +00:00

36 lines
1020 B
Diff

From 971c5225bea11b4193e4e69a939410030b420ed1 Mon Sep 17 00:00:00 2001
From: Lans Zhang <jia.zhang@windriver.com>
Date: Wed, 9 Aug 2017 16:10:14 +0800
Subject: [PATCH] fallback: fix double free of dp
If the boot option recorded in csv is not in a media device path, the
corresponding full device path will be referred for creating the boot
variable.
However, the current code logic always frees the full device path
(full_device_path) and the media device path (dp) separately. In order
to resolve this issue, always check whether dp equals to full_device_path
before freeing dp.
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
---
fallback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fallback.c b/fallback.c
index c80652a..0a7058b 100644
--- a/fallback.c
+++ b/fallback.c
@@ -433,7 +433,7 @@ err:
FreePool(file);
if (full_device_path)
FreePool(full_device_path);
- if (dp)
+ if (dp && dp != full_device_path)
FreePool(dp);
if (fullpath)
FreePool(fullpath);
--
2.14.0