1 Star 0 Fork 26

yueryoufeng/ghostscript

forked from src-openEuler/ghostscript 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Bug-707510-fix-LIBIDN-usage.patch 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxianting 提交于 2024-07-12 18:03 . Fix CVE-2024-29511
From d99396635f3d6ac6a1168e1af21a669e5c8f695f Mon Sep 17 00:00:00 2001
From: Ken Sharp <Ken.Sharp@artifex.com>
Date: Thu, 25 Jan 2024 12:16:56 +0000
Subject: [PATCH 7/7] Bug 707510 - fix LIBIDN usage
http://www.ghostscript.com/cgi-bin/findgit.cgi?d99396635f3d6ac6a1168e1af21a669e5c8f695f
This wasn't a reported fault, but it bears fixing anyway.
In case of ignored errors, we need to return the input password.
And not free the buffer if we did that....
---
pdf/pdf_sec.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pdf/pdf_sec.c b/pdf/pdf_sec.c
index 841eb72..270ed32 100644
--- a/pdf/pdf_sec.c
+++ b/pdf/pdf_sec.c
@@ -182,8 +182,11 @@ static int apply_sasl(pdf_context *ctx, char *Password, int Len, char **NewPassw
* Fortunately, the stringprep error codes are sorted to make
* this easy: the errors we want to ignore are the ones with
* codes less than 100. */
- if ((int)err < 100)
+ if ((int)err < 100) {
+ NewPassword = Password;
+ NewLen = Len;
return 0;
+ }
return_error(gs_error_ioerror);
}
@@ -301,7 +304,8 @@ error:
pdfi_countdown(Key);
gs_free_object(ctx->memory, Test, "R5 password test");
#ifdef HAVE_LIBIDN
- gs_free_object(ctx->memory, UTF8_Password, "free sasl result");
+ if (UTF8_Password != Password)
+ gs_free_object(ctx->memory, UTF8_Password, "free sasl result");
#endif
return code;
}
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yinyongkang/ghostscript.git
git@gitee.com:yinyongkang/ghostscript.git
yinyongkang
ghostscript
ghostscript
master

搜索帮助