1 Star 0 Fork 98

zjut_zy/grub2

forked from 余诗/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-video-readers-png-Refuse-to-handle-multiple-image-headers.patch 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
From 347880a13c239b4c2811c94c9a7cf78b607332e3 Mon Sep 17 00:00:00 2001
From: Daniel Axtens <[email protected]>
Date: Tue, 6 Jul 2021 14:13:40 +1000
Subject: video/readers/png: Refuse to handle multiple image headers
This causes the bitmap to be leaked. Do not permit multiple image headers.
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit/?id=347880a13c239b4c2811c94c9a7cf78b607332e3
Conflict:NA
Signed-off-by: Daniel Axtens <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
---
grub-core/video/readers/png.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c
index d715c46..35ae553 100644
--- a/grub-core/video/readers/png.c
+++ b/grub-core/video/readers/png.c
@@ -258,6 +258,9 @@ grub_png_decode_image_header (struct grub_png_data *data)
int color_bits;
enum grub_video_blit_format blt;
+ if (data->image_width || data->image_height)
+ return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: two image headers found");
+
data->image_width = grub_png_get_dword (data);
data->image_height = grub_png_get_dword (data);
--
cgit v1.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zjuzy/grub2.git
[email protected]:zjuzy/grub2.git
zjuzy
grub2
grub2
master

搜索帮助