зеркало из https://github.com/github/codeql.git
require the file to be non-empty
This commit is contained in:
Родитель
b1cbfce50b
Коммит
b2ccec28e0
|
@ -69,6 +69,8 @@ class UselessCat extends DataFlow::CallNode {
|
|||
this = candidate and
|
||||
// We can create an equivalent `fs.readFile` call.
|
||||
exists(createReadFileCall(this)) and
|
||||
// There is a file to read, and not just a pair of quotes.
|
||||
candidate.getFileArgument().length() >= 3 and
|
||||
// wildcards, pipes, redirections, and multiple files are OK.
|
||||
// (The multiple files detection relies on the fileArgument not containing spaces anywhere)
|
||||
not candidate.getFileArgument().regexpMatch(".*(\\*|\\||>|<| ).*") and
|
||||
|
|
Загрузка…
Ссылка в новой задаче