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")
67 message.
error() <<
"taint rule must have \"kind\" which is "
68 "\"source\" or \"sink\" or \"sanitizer\""
73 const std::string
function = taint_spec[
"function"].value;
78 message.
error() <<
"taint rule must have \"function\""
85 const std::string where = taint_spec[
"where"].value;
87 if(where==
"return_value")
95 else if(std::string(where, 0, 9)==
"parameter")
104 message.
error() <<
"taint rule must have \"where\""
105 <<
" which is \"return_value\" or \"this\" "
106 <<
"or \"parameter1\"..."
111 rule.
taint = taint_spec[
"taint"].value;
112 rule.
message = taint_spec[
"message"].value;
113 rule.
id = taint_spec[
"id"].value;
115 dest.
rules.push_back(rule);
128 case SOURCE: out <<
"SOURCE ";
break;
129 case SINK: out <<
"SINK ";
break;
130 case SANITIZER: out <<
"SANITIZER ";
break;
133 out <<
taint <<
" on ";
148 for(
const auto &rule :
rules)