mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 17:39:50 +00:00
Gracefully handle decodeURIComponent failure
This commit is contained in:
@@ -201,7 +201,14 @@ export function resolveUriToFile(
|
||||
logger.debug(`Ignoring location as URI "${location.uri}" is invalid`);
|
||||
return undefined;
|
||||
}
|
||||
let uri = decodeURIComponent(location.uri as string);
|
||||
|
||||
let uri: string;
|
||||
try {
|
||||
uri = decodeURIComponent(location.uri as string);
|
||||
} catch (e: any) {
|
||||
logger.debug(`Ignoring location as URI "${location.uri}" is invalid`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Remove a file scheme, and abort if the scheme is anything else
|
||||
const fileUriPrefix = "file://";
|
||||
|
||||
Reference in New Issue
Block a user