1 |
mabi 08/05/15 11:35:17 |
2 |
|
3 |
Added: 05_validator.upstream.patch |
4 |
06_c_stack.upstream.patch |
5 |
07_validator2.upstream.patch |
6 |
08_code_injection.upstream.patch |
7 |
Log: |
8 |
bump including some serious crash fixes |
9 |
(Portage version: 2.1.5_rc10) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 dev-lang/lua/files/5.1.3/05_validator.upstream.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/05_validator.upstream.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/05_validator.upstream.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: 05_validator.upstream.patch |
18 |
=================================================================== |
19 |
diff -rdu lua-5.1.3.orig/src/ldebug.c lua-5.1.3/src/ldebug.c |
20 |
--- lua-5.1.3.orig/src/ldebug.c 2008-02-12 16:17:59.000000000 +0000 |
21 |
+++ lua-5.1.3/src/ldebug.c 2008-02-12 16:26:32.000000000 +0000 |
22 |
@@ -275,12 +275,12 @@ |
23 |
|
24 |
static int precheck (const Proto *pt) { |
25 |
check(pt->maxstacksize <= MAXSTACK); |
26 |
- lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); |
27 |
- lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) || |
28 |
+ check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); |
29 |
+ check(!(pt->is_vararg & VARARG_NEEDSARG) || |
30 |
(pt->is_vararg & VARARG_HASARG)); |
31 |
check(pt->sizeupvalues <= pt->nups); |
32 |
check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); |
33 |
- check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); |
34 |
+ check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); |
35 |
return 1; |
36 |
} |
37 |
|
38 |
@@ -363,7 +363,11 @@ |
39 |
} |
40 |
switch (op) { |
41 |
case OP_LOADBOOL: { |
42 |
- check(c == 0 || pc+2 < pt->sizecode); /* check its jump */ |
43 |
+ if (c == 1) { /* does it jump? */ |
44 |
+ check(pc+2 < pt->sizecode); /* check its jump */ |
45 |
+ check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST || |
46 |
+ GETARG_C(pt->code[pc+1]) != 0); |
47 |
+ } |
48 |
break; |
49 |
} |
50 |
case OP_LOADNIL: { |
51 |
@@ -428,7 +432,10 @@ |
52 |
} |
53 |
case OP_SETLIST: { |
54 |
if (b > 0) checkreg(pt, a + b); |
55 |
- if (c == 0) pc++; |
56 |
+ if (c == 0) { |
57 |
+ pc++; |
58 |
+ check(pc < pt->sizecode - 1); |
59 |
+ } |
60 |
break; |
61 |
} |
62 |
case OP_CLOSURE: { |
63 |
|
64 |
|
65 |
|
66 |
1.1 dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch |
67 |
|
68 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch?rev=1.1&view=markup |
69 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch?rev=1.1&content-type=text/plain |
70 |
|
71 |
Index: 06_c_stack.upstream.patch |
72 |
=================================================================== |
73 |
diff -rdu lua-5.1.3.orig/src/lundump.c lua-5.1.3/src/lundump.c |
74 |
--- lua-5.1.3.orig/src/lundump.c 2008-02-12 16:17:59.000000000 +0000 |
75 |
+++ lua-5.1.3/src/lundump.c 2008-02-12 16:26:32.000000000 +0000 |
76 |
@@ -161,7 +160,9 @@ |
77 |
|
78 |
static Proto* LoadFunction(LoadState* S, TString* p) |
79 |
{ |
80 |
- Proto* f=luaF_newproto(S->L); |
81 |
+ Proto* f; |
82 |
+ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); |
83 |
+ f=luaF_newproto(S->L); |
84 |
setptvalue2s(S->L,S->L->top,f); incr_top(S->L); |
85 |
f->source=LoadString(S); if (f->source==NULL) f->source=p; |
86 |
f->linedefined=LoadInt(S); |
87 |
@@ -175,6 +176,7 @@ |
88 |
LoadDebug(S,f); |
89 |
IF (!luaG_checkcode(f), "bad code"); |
90 |
S->L->top--; |
91 |
+ S->L->nCcalls--; |
92 |
return f; |
93 |
} |
94 |
|
95 |
|
96 |
|
97 |
1.1 dev-lang/lua/files/5.1.3/07_validator2.upstream.patch |
98 |
|
99 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/07_validator2.upstream.patch?rev=1.1&view=markup |
100 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/07_validator2.upstream.patch?rev=1.1&content-type=text/plain |
101 |
|
102 |
Index: 07_validator2.upstream.patch |
103 |
=================================================================== |
104 |
diff -rdu lua-5.1.3.orig/src/ldebug.c lua-5.1.3/src/ldebug.c |
105 |
--- lua-5.1.3.orig/src/ldebug.c 2008-02-12 16:17:59.000000000 +0000 |
106 |
+++ lua-5.1.3/src/ldebug.c 2008-02-12 16:26:32.000000000 +0000 |
107 |
@@ -346,9 +346,18 @@ |
108 |
int dest = pc+1+b; |
109 |
check(0 <= dest && dest < pt->sizecode); |
110 |
if (dest > 0) { |
111 |
- /* cannot jump to a setlist count */ |
112 |
- Instruction d = pt->code[dest-1]; |
113 |
- check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)); |
114 |
+ int j; |
115 |
+ /* check that it does not jump to a setlist count; this |
116 |
+ is tricky, because the count from a previous setlist may |
117 |
+ have the same value of an invalid setlist; so, we must |
118 |
+ go all the way back to the first of them (if any) */ |
119 |
+ for (j = 0; j < dest; j++) { |
120 |
+ Instruction d = pt->code[dest-1-j]; |
121 |
+ if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break; |
122 |
+ } |
123 |
+ /* if 'j' is even, previous value is not a setlist (even if |
124 |
+ it looks like one) */ |
125 |
+ check((j&1) == 0); |
126 |
} |
127 |
} |
128 |
break; |
129 |
|
130 |
|
131 |
|
132 |
1.1 dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch |
133 |
|
134 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch?rev=1.1&view=markup |
135 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch?rev=1.1&content-type=text/plain |
136 |
|
137 |
Index: 08_code_injection.upstream.patch |
138 |
=================================================================== |
139 |
diff -ur lua-5.1.3.orig/src/lundump.c lua-5.1.3/src/lundump.c |
140 |
--- lua-5.1.3.orig/src/lundump.c 2008-05-15 09:24:32.000000000 +0200 |
141 |
+++ lua-5.1.3/src/lundump.c 2008-05-15 09:25:18.000000000 +0200 |
142 |
@@ -115,7 +115,7 @@ |
143 |
setnilvalue(o); |
144 |
break; |
145 |
case LUA_TBOOLEAN: |
146 |
- setbvalue(o,LoadChar(S)); |
147 |
+ setbvalue(o,LoadChar(S)!=0); |
148 |
break; |
149 |
case LUA_TNUMBER: |
150 |
setnvalue(o,LoadNumber(S)); |
151 |
|
152 |
|
153 |
|
154 |
-- |
155 |
gentoo-commits@l.g.o mailing list |