/// <summary> /// If function is a reporting function, a warning might be created. /// </summary> /// <param name="p">program point with a function</param> /// <param name="taintInfo">TaintInfo that is being sanitized</param> private void warningsReportingFunct(NativeAnalyzerPoint p, TaintInfo taintInfo) { NativeAnalyzerMethod method = p.Analyzer.Method; QualifiedName functName = getMethodName(p); functAnalyzer = NativeFunctionAnalyzer.CreateInstance(); List <FlagType> flags; if (functAnalyzer.ReportingFunctions.TryGetValue(functName, out flags)) { createWarnings(p, taintInfo, flags); } }
/// <summary> /// If the function is a sanitizer, the sanitized taint flows are removed /// </summary> /// <param name="p">program point with a function</param> /// <param name="taintInfo">TaintInfo that is being sanitized</param> private void sanitize(NativeAnalyzerPoint p, ref TaintInfo taintInfo) { NativeAnalyzerMethod method = p.Analyzer.Method; QualifiedName functName = getMethodName(p); functAnalyzer = NativeFunctionAnalyzer.CreateInstance(); List <FlagType> flags; if (functAnalyzer.SanitizingFunctions.TryGetValue(functName, out flags)) { taintInfo.setSanitized(flags); } }