public void doTest() {
      ArrayList arrayList = new ArrayList();
      LinkedList linkedList = new LinkedList();
      ((TaintedWithObjTag) arrayList).setPHOSPHOR_TAG(new Taint("arraylist tag"));
      ((TaintedWithObjTag) linkedList).setPHOSPHOR_TAG(new Taint("arraylist tag"));

      leakInformationBit(linkedList);
      leakInformationBit(arrayList);
      leakInformationBit(linkedList);
    }
 public static String taintedString(String string) {
   Object r = new String(string.toCharArray());
   ((TaintedWithObjTag) r).setPHOSPHOR_TAG(new Taint("Some tainted data " + (++i)));
   return (String) r;
 }
示例#3
0
 public static void taintedObject(Object obj, Taint tag) {
   if (obj instanceof MultiDTaintedArrayWithObjTag)
     obj = ((MultiDTaintedArrayWithObjTag) obj).getVal();
   if (obj instanceof TaintedWithObjTag) ((TaintedWithObjTag) obj).setPHOSPHOR_TAG(tag);
   else if (obj != null && ArrayHelper.engaged == 1) ArrayHelper.setTag(obj, tag);
 }