21 const std::string &file_name,
30 message.
error() <<
"taint file is not a valid json file" 38 message.
error() <<
"expecting an array in the taint file, but got " 43 for(jsont::arrayt::const_iterator
51 message.
error() <<
"expecting an array of objects " 52 <<
"in the taint file, but got " 59 const std::string kind=(*it)[
"kind"].value;
60 const std::string
function=(*it)[
"function"].value;
61 const std::string where=(*it)[
"where"].value;
62 const std::string taint=(*it)[
"taint"].value;
63 const std::string message=(*it)[
"message"].value;
64 const std::string
id=(*it)[
"id"].value;
70 else if(kind==
"sanitizer")
75 message.
error() <<
"taint rule must have \"kind\" which is " 76 "\"source\" or \"sink\" or \"sanitizer\"" 84 message.
error() <<
"taint rule must have \"function\"" 91 if(where==
"return_value")
95 else if(where==
"this")
99 else if(std::string(where, 0, 9)==
"parameter")
108 message.
error() <<
"taint rule must have \"where\"" 109 <<
" which is \"return_value\" or \"this\" " 110 <<
"or \"parameter1\"..." 119 dest.
rules.push_back(rule);
132 case SOURCE: out <<
"SOURCE ";
break;
133 case SINK: out <<
"SINK ";
break;
134 case SANITIZER: out <<
"SANITIZER ";
break;
137 out <<
taint <<
" on ";
152 for(
const auto &rule :
rules)
void output(std::ostream &) const
enum taint_parse_treet::rulet::@2 where
void output(std::ostream &) const
bool parse_json(std::istream &in, const std::string &filename, message_handlert &message_handler, jsont &dest)
enum taint_parse_treet::rulet::@1 kind
Class that provides messages with a built-in verbosity 'level'.
bool taint_parser(const std::string &file_name, taint_parse_treet &dest, message_handlert &message_handler)
unsigned safe_string2unsigned(const std::string &str, int base)
unsigned parameter_number
irep_idt function_identifier
json_objectt json(const source_locationt &location)