mujs/0002-Issue-161-Don-t-fclose-a-FILE-that-is-NULL.patch
leeffo e9d9c58dc3 fix CVE-2022-30974 CVE-2022-30975
(cherry picked from commit 00909060aee6fdf2577bf1576131a73a9829329b)
2022-09-27 10:48:22 +08:00

26 lines
555 B
Diff

From 910acc807c3c057e1c0726160808f3a9f37b40ec Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor.andersson@artifex.com>
Date: Tue, 17 May 2022 15:53:30 +0200
Subject: [PATCH 2/3] Issue #161: Don't fclose a FILE that is NULL.
---
pp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pp.c b/pp.c
index bf6000c..2657369 100644
--- a/pp.c
+++ b/pp.c
@@ -34,7 +34,7 @@ void js_ppfile(js_State *J, const char *filename, int minify)
if (js_try(J)) {
js_free(J, s);
- fclose(f);
+ if (f) fclose(f);
js_throw(J);
}
--
2.20.1