1 Star 0 Fork 4

cenhuilin/mujs

forked from src-openEuler/mujs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-Issue-161-Cope-with-empty-programs-in-mujs-pp.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
Venland 提交于 2022-09-27 10:41 . fix CVE-2022-30974 CVE-2022-30975
From f5b3c703e18725e380b83427004632e744f85a6f Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor.andersson@artifex.com>
Date: Tue, 17 May 2022 15:57:00 +0200
Subject: [PATCH 3/3] Issue #161: Cope with empty programs in mujs-pp.
---
jsdump.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/jsdump.c b/jsdump.c
index 86361e6..42c9f0f 100644
--- a/jsdump.c
+++ b/jsdump.c
@@ -682,11 +682,13 @@ static void pstmlist(int d, js_Ast *list)
void jsP_dumpsyntax(js_State *J, js_Ast *prog, int dominify)
{
minify = dominify;
- if (prog->type == AST_LIST)
- pstmlist(-1, prog);
- else {
- pstm(0, prog);
- nl();
+ if (prog) {
+ if (prog->type == AST_LIST)
+ pstmlist(-1, prog);
+ else {
+ pstm(0, prog);
+ nl();
+ }
}
if (minify > 1)
putchar('\n');
@@ -768,11 +770,13 @@ static void sblock(int d, js_Ast *list)
void jsP_dumplist(js_State *J, js_Ast *prog)
{
minify = 0;
- if (prog->type == AST_LIST)
- sblock(0, prog);
- else
- snode(0, prog);
- nl();
+ if (prog) {
+ if (prog->type == AST_LIST)
+ sblock(0, prog);
+ else
+ snode(0, prog);
+ nl();
+ }
}
/* Compiled code */
--
2.20.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cenhuilin/mujs.git
git@gitee.com:cenhuilin/mujs.git
cenhuilin
mujs
mujs
master

搜索帮助