Beispiel #1
0
 public static Fortify_Scan mapSources(this Fortify_Scan fortifyScan)
 {
     foreach (var source in fortifyScan._fvdl.ProgramData.Sources.SourceInstance)
     {
         try
         {
             var fortifySource = new Fortify_Source()
             {
                 RuleID = source.ruleID.str(),
             };
             if (source.FunctionCall.notNull())
             {
                 fortifySource.Function_Call = new Fortify_Function(source.FunctionCall.Function.name, source.FunctionCall.SourceLocation);
             }
             if (source.FunctionCall.notNull())
             {
                 fortifySource.Function_Entry = new Fortify_Function(source.FunctionCall.Function.name, source.FunctionCall.SourceLocation);
             }
             if (source.TaintFlags.notNull())
             {
                 fortifySource.TaintFlags = (from taintFlag in source.TaintFlags.TaintFlag
                                             select taintFlag.name).toList();
             }
             fortifyScan.Sources.Add(fortifySource);
         }
         catch (Exception ex)
         {
             "Error Adding Source: {0}".error(ex.Message);
         }
     }
     return(fortifyScan);
 }
Beispiel #2
0
		public static Fortify_Scan mapSources(this Fortify_Scan fortifyScan)
		{
			foreach(var source in fortifyScan._fvdl.ProgramData.Sources.SourceInstance)
			{		
				try
				{
					var fortifySource = new Fortify_Source()
												{
													RuleID = source.ruleID.str() ,												
												};
					if (source.FunctionCall.notNull())											
						fortifySource.Function_Call = new Fortify_Function(source.FunctionCall.Function.name,source.FunctionCall.SourceLocation);
					if (source.FunctionCall.notNull())	
						fortifySource.Function_Entry = new Fortify_Function(source.FunctionCall.Function.name,source.FunctionCall.SourceLocation);
					if (source.TaintFlags.notNull())
						fortifySource.TaintFlags = (from taintFlag in source.TaintFlags.TaintFlag
													select taintFlag.name).toList();
					fortifyScan.Sources.Add(fortifySource); 
				}
				catch(Exception ex)
				{
					"Error Adding Source: {0}".error(ex.Message);
				}
			}
			return fortifyScan;		
		}