[SERVER-72493] mongo crashes if jsconfig.json exists but has no compilerOptions.baseUrl field Created: 03/Jan/23  Updated: 29/Oct/23  Resolved: 04/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Sophia Tan Assignee: Matt Broadstone
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2023-01-09
Participants:

 Description   

If `jsconfig.json` exists but has no compilerOptions.baseUrl field, the mono shell will crash when try to read string value for the baseUrl from null/undefined.



 Comments   
Comment by Githook User [ 04/Jan/23 ]

Author:

{'name': 'Matt Broadstone', 'email': 'mbroadst@mongodb.com', 'username': 'mbroadst'}

Message: SERVER-72493 Require string when resolving module loader baseUrl
Branch: master
https://github.com/mongodb/mongo/commit/ac34ce925aaecae713fa3da0d90532ff23d0a0bd

Comment by Matt Broadstone [ 03/Jan/23 ]

A little more context here. The line which tries to access the compilerOptions.baseUrl property mistakenly assumes the result of JS_GetProperty ensures the value was read (and is not undefined or null). The fix must ensure the value is a string.

Generated at Thu Feb 08 06:21:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.