CPP: TlsSettingsMisconfiguration.ql performance and cleanup - #2249
Conversation
This is not strictly behaviour preserving, but I believe the parts I've removed or simplified weren't intended to do what they were doing.
jbj
left a comment
There was a problem hiding this comment.
The changes LGTM, but I think there is some more low-hanging fruit to pick. The from ... select contains lots of restrictions that I think could be moved into the isSource definition. A rule of thumb in data flow queries is that everything that can be phrased as a unary predicate on source or sink should be moved into isSource and isSink respectively.
Concretely, I think we want a predicate isProtocolSource(Expr protocolSource, ConstructorCall cc, Expr e, string msg), and isSource is then isProtocolSource(source.asExpr(), _, _, _).
|
Thanks for the suggestions - I will do a follow-up PR after this one is merged. The main thing I wanted to fix here was |
|
The qlformat check has failed. |
|
Fixed format. |
This query was performing really poorly, due to some haphazard use of dataflow. This PR makes some improvements, not all of which are exactly behaviour preserving - but the tests are not affected, nor are results on any snapshot I've found.