mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Now able to track error handler registration via instance properties
This commit is contained in:
@@ -227,6 +227,13 @@ private predicate hasErrorHandlerRegistered(PipeCall pipeCall) {
|
||||
stream = base.getAPropertyRead(propName) and
|
||||
base.getAPropertyRead(propName).getAMethodCall(_) instanceof ErrorHandlerRegistration
|
||||
)
|
||||
or
|
||||
exists(DataFlow::PropWrite propWrite, DataFlow::SourceNode instance |
|
||||
propWrite.getRhs().getALocalSource() = stream and
|
||||
instance = propWrite.getBase().getALocalSource() and
|
||||
instance.getAPropertyRead(propWrite.getPropertyName()).getAMethodCall(_) instanceof
|
||||
ErrorHandlerRegistration
|
||||
)
|
||||
)
|
||||
)
|
||||
or
|
||||
|
||||
@@ -16,5 +16,4 @@
|
||||
| tst.js:44:5:44:40 | wrapper ... Stream) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| tst.js:52:5:52:37 | source. ... Stream) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| tst.js:59:18:59:39 | stream. ... Stream) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| tst.js:73:5:73:40 | wrapper ... Stream) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
| tst.js:111:5:111:26 | stream. ... Stream) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
|
||||
|
||||
@@ -70,7 +70,7 @@ class StreamWrapper2 {
|
||||
function zip5() {
|
||||
const zipStream = createWriteStream(zipPath);
|
||||
let wrapper = new StreamWrapper2();
|
||||
wrapper.outputStream.pipe(zipStream); // $SPURIOUS:Alert
|
||||
wrapper.outputStream.pipe(zipStream);
|
||||
zipStream.on('error', e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user