Fixing security bug
This commit is contained in:
parent
94131c55a0
commit
71a6e3f2e0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/jrpcgen",
|
"name": "@hibas123/jrpcgen",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"packageManager": "yarn@3.1.1",
|
"packageManager": "yarn@3.1.1",
|
||||||
@ -8,7 +8,7 @@
|
|||||||
"start": "ts-node src/index.ts",
|
"start": "ts-node src/index.ts",
|
||||||
"test-start": "npm run start -- compile examples/example.jrpc --definition=examples/definition.json -o=ts-node:examples/Typescript/out -o=c#:examples/CSharp/Generated",
|
"test-start": "npm run start -- compile examples/example.jrpc --definition=examples/definition.json -o=ts-node:examples/Typescript/out -o=c#:examples/CSharp/Generated",
|
||||||
"test-csharp": "cd examples/CSharp/Example/ && dotnet run",
|
"test-csharp": "cd examples/CSharp/Example/ && dotnet run",
|
||||||
"test-typescript": "ts-node examples/test.ts",
|
"test-typescript": "cd examples/Typescript && ts-node test.ts",
|
||||||
"test": "npm run test-start && npm run test-csharp && npm run test-typescript",
|
"test": "npm run test-start && npm run test-csharp && npm run test-typescript",
|
||||||
"build": "esbuild src/index.ts --bundle --platform=node --target=node14 --outfile=lib/jrpc.js",
|
"build": "esbuild src/index.ts --bundle --platform=node --target=node14 --outfile=lib/jrpc.js",
|
||||||
"prepublishOnly": "npm run build"
|
"prepublishOnly": "npm run build"
|
||||||
|
@ -372,7 +372,9 @@ export class TypescriptTarget extends CompileTarget {
|
|||||||
a(2, `if(Array.isArray(params)){`);
|
a(2, `if(Array.isArray(params)){`);
|
||||||
a(3, `p = params;`);
|
a(3, `p = params;`);
|
||||||
a(3, `while(p.length < ${fnc.inputs.length})`);
|
a(3, `while(p.length < ${fnc.inputs.length})`);
|
||||||
a(4, `p.push(undefined)`);
|
a(4, `p.push(undefined);`);
|
||||||
|
a(3, `if(p.length > ${fnc.inputs.length})`);
|
||||||
|
a(4, `throw new Error("Too many parameters!");`);
|
||||||
a(2, `} else {`);
|
a(2, `} else {`);
|
||||||
for (const param of fnc.inputs) {
|
for (const param of fnc.inputs) {
|
||||||
a(3, `p.push(params["${param.name}"])`);
|
a(3, `p.push(params["${param.name}"])`);
|
||||||
|
Loading…
Reference in New Issue
Block a user