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 "
45 if(!taint_spec.is_object())
48 message.
error() <<
"expecting an array of objects "
49 <<
"in the taint file, but got " << taint_spec
56 const std::string kind = taint_spec[
"kind"].value;
62 else if(kind==
"sanitizer")
77 const std::string function = taint_spec[
"function"].value;
89 const std::string where = taint_spec[
"where"].value;
91 if(where==
"return_value")
99 else if(std::string(where, 0, 9)==
"parameter")
118 rule.
taint = taint_spec[
"taint"].value;
119 rule.
message = taint_spec[
"message"].value;
120 rule.
id = taint_spec[
"id"].value;
122 dest.
rules.push_back(rule);
135 case SOURCE: out <<
"SOURCE ";
break;
136 case SINK: out <<
"SINK ";
break;
137 case SANITIZER: out <<
"SANITIZER ";
break;
140 out <<
taint <<
" on ";
155 for(
const auto &rule :
rules)
Class that provides messages with a built-in verbosity 'level'.
static const commandt quote_begin
Start quoted text.
static const commandt quote_end
End quoted text.
enum taint_parse_treet::rulet::@372246201243073015235235204214131221121266070257 kind
void output(std::ostream &) const
irep_idt function_identifier
enum taint_parse_treet::rulet::@124324345376274174107362344356270161361121251254 where
unsigned parameter_number
void output(std::ostream &) const
const std::string & id2string(const irep_idt &d)
json_arrayt & to_json_array(jsont &json)
bool parse_json(std::istream &in, const std::string &filename, message_handlert &message_handler, jsont &dest)
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
unsigned safe_string2unsigned(std::string_view str, int base)
bool taint_parser(const std::string &file_name, taint_parse_treet &dest, message_handlert &message_handler)