mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Added detection of custom gulp-plumber sanitizer, thus one would not flag such instances.
This commit is contained in:
@@ -188,6 +188,15 @@ predicate hasErrorHandlerRegistered(PipeCall pipeCall) {
|
||||
handler = streamRef(pipeCall).getAMethodCall(getEventHandlerMethodName()) and
|
||||
handler.getArgument(0).getStringValue() = "error"
|
||||
)
|
||||
or
|
||||
hasPlumber(pipeCall)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if one of the arguments of the pipe call is a `gulp-plumber` monkey patch.
|
||||
*/
|
||||
predicate hasPlumber(PipeCall pipeCall) {
|
||||
streamRef+(pipeCall) = API::moduleImport("gulp-plumber").getACall()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,5 +13,3 @@
|
||||
| test.js:185:5:185:32 | copyStr ... nation) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| test.js:190:17:190:40 | notStre ... itable) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| test.js:195:17:195:40 | notStre ... itable) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| test.js:207:5:207:64 | getStre ... e(dest) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| test.js:212:5:212:56 | getStre ... e(dest) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
|
||||
@@ -204,11 +204,11 @@ function test() {
|
||||
}
|
||||
{
|
||||
const plumber = require('gulp-plumber');
|
||||
getStream().pipe(plumber()).pipe(dest).pipe(dest).pipe(dest); // $SPURIOUS:Alert
|
||||
getStream().pipe(plumber()).pipe(dest).pipe(dest).pipe(dest);
|
||||
}
|
||||
{
|
||||
const plumber = require('gulp-plumber');
|
||||
const p = plumber();
|
||||
getStream().pipe(p).pipe(dest).pipe(dest).pipe(dest); // $SPURIOUS:Alert
|
||||
getStream().pipe(p).pipe(dest).pipe(dest).pipe(dest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user