Model panicking log functions better

This commit is contained in:
Owen Mansel-Chan
2026-06-02 01:32:00 +01:00
parent e6e8e3d005
commit 703cea2b65

View File

@@ -47,6 +47,19 @@ module Log {
override predicate mayReturnNormally() { none() }
}
/** A log function which must panic. */
private class PanicLogFunction extends Function {
PanicLogFunction() {
exists(string fn | fn = ["Panic", "Panicf", "Panicln"] |
this.hasQualifiedName("log", fn)
or
this.(Method).hasQualifiedName("log", "Logger", fn)
)
}
override predicate mustPanic() { any() }
}
// These models are not implemented using Models-as-Data because they represent reverse flow.
private class FunctionModels extends TaintTracking::FunctionModel {
FunctionInput inp;