Exemplo n.º 1
0
 public static Taint merge(Taint a, Taint b) {
   Taint result = new Taint(State.merge(a.getState(), b.getState()));
   if (a.hasValidLocalVariableIndex()
       && b.hasValidLocalVariableIndex()
       && a.getLocalVariableIndex() == b.getLocalVariableIndex()) {
     result.setLocalVariableIndex(a.getLocalVariableIndex());
   }
   return result;
 }
Exemplo n.º 2
0
    public boolean isValidTaintedString (String s, String taintS) {
        if (!s.equals(taintS)) 
            return false;

        Taint t = s.@internal@taint();
        if (t == null)
            t = new Taint(false, s.length());

        Taint tt = taintS.@internal@taint();
        if (tt == null)
            tt = new Taint(false, taintS.length());

        for (int i = 0; i < taintS.length(); i++) {
            if ((p == UNTAINTED && t.get(i))
               || (p == FULLY_TAINTED && !t.get(i)))  
                   return false;

            if (!tt.get(i)) 
                return false;
            
        }

        return true;
    }