Skip to content

Commit c6ce8aa

Browse files
Potential fix for code scanning alert no. 68: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 7e72775 commit c6ce8aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/glob.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Glob {
2424
if (glob.includes('**')) {
2525
// Handle ** which can match across directory boundaries
2626
pattern = glob
27+
.replace(/\\/g, '\\\\')
2728
.replace(/\*\*/g, '__GLOBSTAR__')
2829
.replace(/\./g, '\\.')
2930
.replace(/\//g, '\\/')
@@ -33,6 +34,7 @@ class Glob {
3334
} else {
3435
// Handle patterns with * but not **
3536
pattern = glob
37+
.replace(/\\/g, '\\\\')
3638
.replace(/\./g, '\\.')
3739
.replace(/\//g, '\\/')
3840
.replace(/\?/g, '.')

0 commit comments

Comments
 (0)