Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe RegExp.exec() usage? #53153

Closed
bpasero opened this issue Jun 27, 2018 · 3 comments
Closed

Unsafe RegExp.exec() usage? #53153

bpasero opened this issue Jun 27, 2018 · 3 comments
Assignees
Labels
debt Code quality issues terminal Integrated terminal issues
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Jun 27, 2018

While fixing #52576 I made a quick pass of users of RegExp.exec() that do not check the returned result for being null. I found 3 possible locations:

@Tyriar
https://github.com/Microsoft/vscode/blob/d90f82140439e38e1aafc9dc052691dd38f77901/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts#L208
https://github.com/Microsoft/vscode/blob/d90f82140439e38e1aafc9dc052691dd38f77901/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts#L255

@jrieken
https://github.com/Microsoft/vscode/blob/d90f82140439e38e1aafc9dc052691dd38f77901/src/vs/workbench/api/node/extHostDocumentData.ts#L151

Not sure if this ever caused any issue, but I wanted to bring it up nevertheless.

@jrieken jrieken removed their assignment Jun 27, 2018
@jrieken
Copy link
Member

jrieken commented Jun 27, 2018

Using it with a * is always safe.

@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2018

The second one is checked for null earlier in _handleLocalLink.

@Tyriar Tyriar added this to the June 2018 milestone Jun 27, 2018
@Tyriar Tyriar added debt Code quality issues terminal Integrated terminal issues labels Jun 27, 2018
@Tyriar Tyriar closed this as completed in 279ef47 Jun 27, 2018
@bpasero
Copy link
Member Author

bpasero commented Jun 27, 2018

Thanks.

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

3 participants