You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
718 B

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
abstract class Taint {
abstract String badString();
abstract void sendToDb(String arg);
void fOk() {
String s0 = badString();
String s1 = "foo";
if (s0 == s1) return; // Hint for Pulse.
sendToDb(s1);
}
void fBad() {
String s0 = badString();
if (s0 == null) return;
String s1 = "foo" + s0 + "bar";
if (s1 == s0) return;
String s2 = "oops" + s1;
if (s2 == s1 || s2 == s0) return;
String s3 = s1 + s1;
if (s3 == s0 || s3 == s1 || s3 == s2) return;
sendToDb(s2);
}
}