From 084fb5e7bf25f61fc96cd90b40fef8efa7572e5d 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 aeea605e268..6da3395f4c9 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') {