unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 77a3e45cdbd04d6e5a95b99a7310c3de2c79c8a4 1004 bytes (raw)
name: gnu/packages/patches/mupdf-mujs-heap-buffer-overflow.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
This fixes a heap buffer overflow in MuJS as reported at

http://seclists.org/oss-sec/2017/q1/74

Patch lifted from upstream source repository:

https://git.ghostscript.com/?p=mujs.git;h=77ab465f1c394bb77f00966cd950650f3f53cb24

From 77ab465f1c394bb77f00966cd950650f3f53cb24 Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor.andersson@gmail.com>
Date: Thu, 12 Jan 2017 14:47:01 +0100
Subject: [PATCH] Fix 697401: Error when dropping extra arguments to
 lightweight functions.

---
 thirdparty/mujs/jsrun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/thirdparty/mujs/jsrun.c b/thirdparty/mujs/jsrun.c
index ee80845..782a6f9 100644
--- a/thirdparty/mujs/jsrun.c
+++ b/thirdparty/mujs/jsrun.c
@@ -937,7 +937,7 @@ static void jsR_calllwfunction(js_State *J, int n, js_Function *F, js_Environmen
 	jsR_savescope(J, scope);
 
 	if (n > F->numparams) {
-		js_pop(J, F->numparams - n);
+		js_pop(J, n - F->numparams);
 		n = F->numparams;
 	}
 	for (i = n; i < F->varlen; ++i)
-- 
2.9.1


debug log:

solving 77a3e45cd ...
found 77a3e45cd in https://yhetil.org/guix-devel/20170112180655.1588-1-mbakke@fastmail.com/

applying [1/1] https://yhetil.org/guix-devel/20170112180655.1588-1-mbakke@fastmail.com/
diff --git a/gnu/packages/patches/mupdf-mujs-heap-buffer-overflow.patch b/gnu/packages/patches/mupdf-mujs-heap-buffer-overflow.patch
new file mode 100644
index 000000000..77a3e45cd

1:30: space before tab in indent.
 	jsR_savescope(J, scope);
1:31: trailing whitespace.
 
1:32: space before tab in indent.
 	if (n > F->numparams) {
1:35: space before tab in indent.
 		n = F->numparams;
1:36: space before tab in indent.
 	}
Checking patch gnu/packages/patches/mupdf-mujs-heap-buffer-overflow.patch...
Applied patch gnu/packages/patches/mupdf-mujs-heap-buffer-overflow.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

index at:
100644 77a3e45cdbd04d6e5a95b99a7310c3de2c79c8a4	gnu/packages/patches/mupdf-mujs-heap-buffer-overflow.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).