File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,11 @@ module SocketIOClient {
411411 exists ( DataFlow:: TypeTracker t2 | result = socket ( invk , t2 ) .track ( t2 , t ) )
412412 }
413413
414+ /**
415+ * Gets the NPM package that contains `nd`.
416+ */
417+ private NPMPackage getPackage ( DataFlow:: SourceNode nd ) { result .getAFile ( ) = nd .getFile ( ) }
418+
414419 /** A data flow node that may produce a socket object. */
415420 class SocketNode extends DataFlow:: SourceNode {
416421 DataFlow:: InvokeNode invk ;
@@ -445,10 +450,8 @@ module SocketIOClient {
445450 * it can be determined.
446451 */
447452 SocketIO:: ServerObject getATargetServer ( ) {
448- exists ( NPMPackage pkg |
449- result .getOrigin ( ) .getFile ( ) = pkg .getAFile ( ) and
450- this .getFile ( ) = pkg .getAFile ( )
451- |
453+ getPackage ( result .getOrigin ( ) ) = getPackage ( this ) and
454+ (
452455 not exists ( getNamespacePath ( ) ) or
453456 exists ( result .getNamespace ( getNamespacePath ( ) ) )
454457 )
You can’t perform that action at this time.
0 commit comments