-
Notifications
You must be signed in to change notification settings - Fork 273
/
Copy pathtaint_parser.h
73 lines (54 loc) · 1.32 KB
/
taint_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************\
Module: Taint Parser
Author: Daniel Kroening, [email protected]
\*******************************************************************/
/// \file
/// Taint Parser
#ifndef CPROVER_GOTO_ANALYZER_TAINT_PARSER_H
#define CPROVER_GOTO_ANALYZER_TAINT_PARSER_H
#include <string>
#include <list>
#include <iosfwd>
#include <util/irep.h>
class message_handlert;
class taint_parse_treet
{
public:
class rulet
{
public:
enum { SOURCE, SINK, SANITIZER } kind;
enum { THIS, PARAMETER, RETURN_VALUE } where;
bool is_source() const
{
return kind==SOURCE;
}
bool is_sink() const
{
return kind==SINK;
}
bool is_sanitizer() const
{
return kind==SANITIZER;
}
irep_idt id;
irep_idt function_identifier;
irep_idt taint;
unsigned parameter_number; // the first one is '1'
std::string message;
void output(std::ostream &) const;
rulet():
parameter_number(0)
// The other class members are initialized by taint_parser().
{
}
};
typedef std::list<rulet> rulest;
rulest rules;
void output(std::ostream &) const;
};
bool taint_parser(
const std::string &taint_file_name,
taint_parse_treet &,
message_handlert &);
#endif // CPROVER_GOTO_ANALYZER_TAINT_PARSER_H