Skip to content

Instantly share code, notes, and snippets.

@conikeec
Last active October 10, 2019 20:25
Show Gist options
  • Save conikeec/c940ca51f7adf5b76b2992174cc8752c to your computer and use it in GitHub Desktop.
Save conikeec/c940ca51f7adf5b76b2992174cc8752c to your computer and use it in GitHub Desktop.
// there is a call edge from the call site to the
// methodinstance "org.apache.logging.log4j.core.net.server.LogEventBridge.logEvents:void(java.io.InputStream,org.apache.logging.log4j.core.LogEventListener)",
// which is the interface method not the actual implementation of the code
val implementation = serverCpg.methodInstance.fullNameExact("org.apache.logging.log4j.core.net.server.ObjectInputStreamLogEventBridge.logEvents:void(java.io.ObjectInputStream,org.apache.logging.log4j.core.LogEventListener)").head
val methodInterface = "org.apache.logging.log4j.core.net.server.LogEventBridge.logEvents:void(java.io.InputStream,org.apache.logging.log4j.core.LogEventListener)"
serverCpg.methodInstance.fullNameExact(methodInterface).callIn.l.foreach { c =>
c.addEdge(EdgeTypes.CALL, implementation)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment