From 407be8f0dc92de45b5669de5e8ce05d857702001 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 15 Jun 2021 03:34:45 -0700 Subject: [PATCH] Add better checks for start index and length --- src/vs/workbench/api/common/extHostTypes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 2ed9688c95d..87d45f2f0ae 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1713,10 +1713,10 @@ export class TerminalLink implements vscode.TerminalLink { public length: number, public tooltip?: string ) { - if (typeof startIndex !== 'number') { + if (typeof startIndex !== 'number' || startIndex < 0) { throw illegalArgument('startIndex'); } - if (typeof length !== 'number') { + if (typeof length !== 'number' || length < 1) { throw illegalArgument('length'); } if (tooltip !== undefined && typeof tooltip !== 'string') {