Skip to content

Commit d8a96dd

Browse files
committed
change name to suggestion from previous code review
1 parent 922779e commit d8a96dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/semmle/javascript/security/UselessUseOfCat.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class UselessCat extends CommandCall {
105105
getArgument(0).mayHaveStringValue(getACatExecuteable())
106106
) and
107107
// wildcards, pipes, redirections, other bash features, and multiple files (spaces) are OK.
108-
not containsNonTrivialBashChar(getNonCommandConstantString()) and
108+
not containsNonTrivialShellChar(getNonCommandConstantString()) and
109109
// Only acceptable option is "encoding", everything else is non-trivial to emulate with fs.readFile.
110110
(
111111
not exists(getOptionsArg())
@@ -174,7 +174,7 @@ module PrettyPrintCatCall {
174174
) and
175175
fileArg = createFileArgument(cat).trim() and
176176
// sanity check in case of surprising `toString` results, other uses of `containsNonTrivialBashChar` should ensure that this conjunct will hold most of the time
177-
not(containsNonTrivialBashChar(fileArg.regexpReplaceAll("\\$|\\`| ", ""))) // string concat might contain " ", template strings might contain "$" or `, and that is OK.
177+
not(containsNonTrivialShellChar(fileArg.regexpReplaceAll("\\$|\\`| ", ""))) // string concat might contain " ", template strings might contain "$" or `, and that is OK.
178178
|
179179
result =
180180
"fs.readFile" + sync + "(" + fileArg + extraArg + callback + ")"

0 commit comments

Comments
 (0)