File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
python/ql/lib/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -254,10 +254,14 @@ module Stdlib {
254254 * See https://docs.python.org/3.9/library/logging.html#logging.Logger.
255255 */
256256 module Logger {
257+ private import semmle.python.dataflow.new.internal.DataFlowDispatch as DD
258+
257259 /** Gets a reference to the `logging.Logger` class or any subclass. */
258260 API:: Node subclassRef ( ) {
259261 result = API:: moduleImport ( "logging" ) .getMember ( "Logger" ) .getASubclass * ( )
260262 or
263+ result = API:: moduleImport ( "logging" ) .getMember ( "getLoggerClass" ) .getReturn ( ) .getASubclass * ( )
264+ or
261265 result = ModelOutput:: getATypeNode ( "logging.Logger~Subclass" ) .getASubclass * ( )
262266 }
263267
@@ -277,6 +281,13 @@ module Stdlib {
277281 ClassInstantiation ( ) {
278282 this = subclassRef ( ) .getACall ( )
279283 or
284+ this =
285+ DD:: selfTracker ( subclassRef ( )
286+ .getAValueReachableFromSource ( )
287+ .asExpr ( )
288+ .( ClassExpr )
289+ .getInnerScope ( ) )
290+ or
280291 this = API:: moduleImport ( "logging" ) .getMember ( "root" ) .asSource ( )
281292 or
282293 this = API:: moduleImport ( "logging" ) .getMember ( "getLogger" ) .getACall ( )
You can’t perform that action at this time.
0 commit comments