Merge pull request #1284 from esben-semmle/js/fix-azure-performance

JS: fix azure performance
This commit is contained in:
Max Schaefer
2019-04-29 13:15:16 +01:00
committed by GitHub

View File

@@ -411,6 +411,11 @@ module SocketIOClient {
exists(DataFlow::TypeTracker t2 | result = socket(invk, t2).track(t2, t))
}
/**
* Gets the NPM package that contains `nd`.
*/
private NPMPackage getPackage(DataFlow::SourceNode nd) { result.getAFile() = nd.getFile() }
/** A data flow node that may produce a socket object. */
class SocketNode extends DataFlow::SourceNode {
DataFlow::InvokeNode invk;
@@ -445,10 +450,8 @@ module SocketIOClient {
* it can be determined.
*/
SocketIO::ServerObject getATargetServer() {
exists(NPMPackage pkg |
result.getOrigin().getFile() = pkg.getAFile() and
this.getFile() = pkg.getAFile()
|
getPackage(result.getOrigin()) = getPackage(this) and
(
not exists(getNamespacePath()) or
exists(result.getNamespace(getNamespacePath()))
)