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 {
254
254
* See https://docs.python.org/3.9/library/logging.html#logging.Logger.
255
255
*/
256
256
module Logger {
257
+ private import semmle.python.dataflow.new.internal.DataFlowDispatch as DD
258
+
257
259
/** Gets a reference to the `logging.Logger` class or any subclass. */
258
260
API:: Node subclassRef ( ) {
259
261
result = API:: moduleImport ( "logging" ) .getMember ( "Logger" ) .getASubclass * ( )
260
262
or
263
+ result = API:: moduleImport ( "logging" ) .getMember ( "getLoggerClass" ) .getReturn ( ) .getASubclass * ( )
264
+ or
261
265
result = ModelOutput:: getATypeNode ( "logging.Logger~Subclass" ) .getASubclass * ( )
262
266
}
263
267
@@ -277,6 +281,13 @@ module Stdlib {
277
281
ClassInstantiation ( ) {
278
282
this = subclassRef ( ) .getACall ( )
279
283
or
284
+ this =
285
+ DD:: selfTracker ( subclassRef ( )
286
+ .getAValueReachableFromSource ( )
287
+ .asExpr ( )
288
+ .( ClassExpr )
289
+ .getInnerScope ( ) )
290
+ or
280
291
this = API:: moduleImport ( "logging" ) .getMember ( "root" ) .asSource ( )
281
292
or
282
293
this = API:: moduleImport ( "logging" ) .getMember ( "getLogger" ) .getACall ( )
You can’t perform that action at this time.
0 commit comments