Skip to content

Commit

Permalink
[taint] Add Kotlin test to demonstrate that checking for value histor…
Browse files Browse the repository at this point in the history
…y is necessary

Summary: Add Kotlin test to demonstrate that checking for value history is necessary

Reviewed By: dulmarod

Differential Revision:
D50227083

Privacy Context Container: L1122176

fbshipit-source-id: 65cb78cde98f89a25627ade62e3bff9d54e3c88d
  • Loading branch information
geralt-encore authored and facebook-github-bot committed Oct 13, 2023
1 parent ba6ac64 commit 7178e5b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions infer/tests/codetoanalyze/kotlin/pulse/taint/Basics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,12 @@ class Basics {
InferTaint.inferSensitiveSink(
InferTaint.inferUniversalSanitizer(InferTaint.inferSecretSource()))
}

fun taintOnUnrelatedBooleanOk(notTaintedFlag: Boolean) {
val taintedFlag = InferTaint.inferSecretSource() as Boolean
val uberFlag = notTaintedFlag || taintedFlag
if (!uberFlag) {
InferTaint.inferSensitiveSink(notTaintedFlag)
}
}
}

0 comments on commit 7178e5b

Please sign in to comment.