diff --git a/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll b/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll index c3665589482..a0d3414f249 100644 --- a/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll +++ b/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll @@ -34,12 +34,9 @@ module CleartextStoragePreferencesConfig implements DataFlow::ConfigSig { predicate observeDiffInformedIncrementalMode() { any() } Location getASelectedSinkLocation(DataFlow::Node sink) { - exists(DataFlow::Node cleanSink | result = cleanSink.getLocation() | - cleanSink = sink.(DataFlow::PostUpdateNode).getPreUpdateNode() - or - not sink instanceof DataFlow::PostUpdateNode and - cleanSink = sink - ) + result = sink.(CleartextStoragePreferencesSink).getLocation() + or + result = sink.(DataFlow::PostUpdateNode).getPreUpdateNode().getLocation() } }