File: 03-fix-buffer-overflow.diff

package info (click to toggle)
squirrel3 3.1-8.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,380 kB
  • sloc: cpp: 12,722; ansic: 917; makefile: 316; python: 40
file content (22 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From a6413aa690e0bdfef648c68693349a7b878fe60d Mon Sep 17 00:00:00 2001
From: Alberto Demichelis <albertodemichelis@hotmail.com>
Date: Mon, 2 May 2022 12:04:58 +0200
Subject: [PATCH] fix in thread.call

---
 squirrel/sqbaselib.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/squirrel/sqbaselib.cpp b/squirrel/sqbaselib.cpp
index 662aeac..e283900 100644
--- a/squirrel/sqbaselib.cpp
+++ b/squirrel/sqbaselib.cpp
@@ -1012,6 +1012,7 @@ static SQInteger thread_call(HSQUIRRELVM v)
     SQObjectPtr o = stack_get(v,1);
     if(type(o) == OT_THREAD) {
         SQInteger nparams = sq_gettop(v);
+        sq_reservestack(_thread(o), nparams + 3);
         _thread(o)->Push(_thread(o)->_roottable);
         for(SQInteger i = 2; i<(nparams+1); i++)
             sq_move(_thread(o),v,i);