Skip to content

Commit db557a4

Browse files
authored
Merge pull request github#3570 from geoffw0/mysprintftest
C++: Fix mysprintf in taint test
2 parents f952293 + 95537ed commit db557a4

File tree

4 files changed

+133
-127
lines changed

4 files changed

+133
-127
lines changed

cpp/ql/test/library-tests/dataflow/taint-tests/format.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ int vsnprintf(char *s, size_t n, const char *format, va_list arg);
1515

1616
int mysprintf(char *s, size_t n, const char *format, ...)
1717
{
18+
int result;
19+
1820
va_list args;
1921
va_start(args, format);
20-
vsnprintf(s, n, format, args);
22+
result = vsnprintf(s, n, format, args);
2123
va_end(args);
24+
25+
return result;
2226
}
2327

2428
int sscanf(const char *s, const char *format, ...);

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 108 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -3,112 +3,114 @@
33
| file://:0:0:0:0 | p#0 | file://:0:0:0:0 | p#0 | |
44
| file://:0:0:0:0 | p#0 | file://:0:0:0:0 | p#0 | |
55
| file://:0:0:0:0 | p#0 | file://:0:0:0:0 | p#0 | |
6-
| format.cpp:16:21:16:21 | s | format.cpp:20:13:20:13 | s | |
7-
| format.cpp:16:31:16:31 | n | format.cpp:20:16:20:16 | n | |
8-
| format.cpp:16:46:16:51 | format | format.cpp:20:19:20:24 | format | |
9-
| format.cpp:18:10:18:13 | args | format.cpp:20:27:20:30 | args | |
10-
| format.cpp:46:21:46:24 | {...} | format.cpp:47:17:47:22 | buffer | |
11-
| format.cpp:46:21:46:24 | {...} | format.cpp:48:8:48:13 | buffer | |
12-
| format.cpp:46:23:46:23 | 0 | format.cpp:46:21:46:24 | {...} | TAINT |
13-
| format.cpp:47:17:47:22 | ref arg buffer | format.cpp:48:8:48:13 | buffer | |
14-
| format.cpp:47:30:47:33 | %s | format.cpp:47:17:47:22 | ref arg buffer | TAINT |
15-
| format.cpp:47:36:47:43 | Hello. | format.cpp:47:17:47:22 | ref arg buffer | TAINT |
16-
| format.cpp:51:21:51:24 | {...} | format.cpp:52:17:52:22 | buffer | |
17-
| format.cpp:51:21:51:24 | {...} | format.cpp:53:8:53:13 | buffer | |
18-
| format.cpp:51:23:51:23 | 0 | format.cpp:51:21:51:24 | {...} | TAINT |
19-
| format.cpp:52:17:52:22 | ref arg buffer | format.cpp:53:8:53:13 | buffer | |
20-
| format.cpp:52:30:52:33 | %s | format.cpp:52:17:52:22 | ref arg buffer | TAINT |
21-
| format.cpp:52:36:52:49 | call to source | format.cpp:52:17:52:22 | ref arg buffer | TAINT |
22-
| format.cpp:56:21:56:24 | {...} | format.cpp:57:17:57:22 | buffer | |
23-
| format.cpp:56:21:56:24 | {...} | format.cpp:58:8:58:13 | buffer | |
24-
| format.cpp:56:23:56:23 | 0 | format.cpp:56:21:56:24 | {...} | TAINT |
25-
| format.cpp:57:17:57:22 | ref arg buffer | format.cpp:58:8:58:13 | buffer | |
26-
| format.cpp:57:30:57:43 | call to source | format.cpp:57:17:57:22 | ref arg buffer | TAINT |
27-
| format.cpp:57:48:57:55 | Hello. | format.cpp:57:17:57:22 | ref arg buffer | TAINT |
28-
| format.cpp:61:21:61:24 | {...} | format.cpp:62:17:62:22 | buffer | |
29-
| format.cpp:61:21:61:24 | {...} | format.cpp:63:8:63:13 | buffer | |
30-
| format.cpp:61:23:61:23 | 0 | format.cpp:61:21:61:24 | {...} | TAINT |
31-
| format.cpp:62:17:62:22 | ref arg buffer | format.cpp:63:8:63:13 | buffer | |
32-
| format.cpp:62:30:62:39 | %s %s %s | format.cpp:62:17:62:22 | ref arg buffer | TAINT |
33-
| format.cpp:62:42:62:44 | a | format.cpp:62:17:62:22 | ref arg buffer | TAINT |
34-
| format.cpp:62:47:62:49 | b | format.cpp:62:17:62:22 | ref arg buffer | TAINT |
35-
| format.cpp:62:52:62:65 | call to source | format.cpp:62:17:62:22 | ref arg buffer | TAINT |
36-
| format.cpp:66:21:66:24 | {...} | format.cpp:67:17:67:22 | buffer | |
37-
| format.cpp:66:21:66:24 | {...} | format.cpp:68:8:68:13 | buffer | |
38-
| format.cpp:66:23:66:23 | 0 | format.cpp:66:21:66:24 | {...} | TAINT |
39-
| format.cpp:67:17:67:22 | ref arg buffer | format.cpp:68:8:68:13 | buffer | |
40-
| format.cpp:67:30:67:35 | %.*s | format.cpp:67:17:67:22 | ref arg buffer | TAINT |
41-
| format.cpp:67:38:67:39 | 10 | format.cpp:67:17:67:22 | ref arg buffer | TAINT |
42-
| format.cpp:67:42:67:55 | call to source | format.cpp:67:17:67:22 | ref arg buffer | TAINT |
43-
| format.cpp:72:21:72:24 | {...} | format.cpp:73:17:73:22 | buffer | |
44-
| format.cpp:72:21:72:24 | {...} | format.cpp:74:8:74:13 | buffer | |
45-
| format.cpp:72:23:72:23 | 0 | format.cpp:72:21:72:24 | {...} | TAINT |
46-
| format.cpp:73:17:73:22 | ref arg buffer | format.cpp:74:8:74:13 | buffer | |
47-
| format.cpp:73:30:73:33 | %i | format.cpp:73:17:73:22 | ref arg buffer | TAINT |
48-
| format.cpp:73:36:73:36 | 0 | format.cpp:73:17:73:22 | ref arg buffer | TAINT |
49-
| format.cpp:77:21:77:24 | {...} | format.cpp:78:17:78:22 | buffer | |
50-
| format.cpp:77:21:77:24 | {...} | format.cpp:79:8:79:13 | buffer | |
51-
| format.cpp:77:23:77:23 | 0 | format.cpp:77:21:77:24 | {...} | TAINT |
52-
| format.cpp:78:17:78:22 | ref arg buffer | format.cpp:79:8:79:13 | buffer | |
53-
| format.cpp:78:30:78:33 | %i | format.cpp:78:17:78:22 | ref arg buffer | TAINT |
54-
| format.cpp:78:36:78:41 | call to source | format.cpp:78:17:78:22 | ref arg buffer | TAINT |
55-
| format.cpp:82:21:82:24 | {...} | format.cpp:83:17:83:22 | buffer | |
56-
| format.cpp:82:21:82:24 | {...} | format.cpp:84:8:84:13 | buffer | |
57-
| format.cpp:82:23:82:23 | 0 | format.cpp:82:21:82:24 | {...} | TAINT |
58-
| format.cpp:83:17:83:22 | ref arg buffer | format.cpp:84:8:84:13 | buffer | |
59-
| format.cpp:83:30:83:35 | %.*s | format.cpp:83:17:83:22 | ref arg buffer | TAINT |
60-
| format.cpp:83:38:83:43 | call to source | format.cpp:83:17:83:22 | ref arg buffer | TAINT |
61-
| format.cpp:83:48:83:55 | Hello. | format.cpp:83:17:83:22 | ref arg buffer | TAINT |
62-
| format.cpp:88:21:88:24 | {...} | format.cpp:89:17:89:22 | buffer | |
63-
| format.cpp:88:21:88:24 | {...} | format.cpp:90:8:90:13 | buffer | |
64-
| format.cpp:88:23:88:23 | 0 | format.cpp:88:21:88:24 | {...} | TAINT |
65-
| format.cpp:89:17:89:22 | ref arg buffer | format.cpp:90:8:90:13 | buffer | |
66-
| format.cpp:89:30:89:33 | %p | format.cpp:89:17:89:22 | ref arg buffer | TAINT |
67-
| format.cpp:89:36:89:49 | call to source | format.cpp:89:17:89:22 | ref arg buffer | TAINT |
68-
| format.cpp:94:21:94:24 | {...} | format.cpp:95:16:95:21 | buffer | |
69-
| format.cpp:94:21:94:24 | {...} | format.cpp:96:8:96:13 | buffer | |
70-
| format.cpp:94:23:94:23 | 0 | format.cpp:94:21:94:24 | {...} | TAINT |
71-
| format.cpp:95:16:95:21 | ref arg buffer | format.cpp:96:8:96:13 | buffer | |
72-
| format.cpp:95:24:95:27 | %s | format.cpp:95:16:95:21 | ref arg buffer | TAINT |
73-
| format.cpp:95:30:95:43 | call to source | format.cpp:95:16:95:21 | ref arg buffer | TAINT |
74-
| format.cpp:99:21:99:24 | {...} | format.cpp:100:16:100:21 | buffer | |
75-
| format.cpp:99:21:99:24 | {...} | format.cpp:101:8:101:13 | buffer | |
76-
| format.cpp:99:23:99:23 | 0 | format.cpp:99:21:99:24 | {...} | TAINT |
77-
| format.cpp:100:16:100:21 | ref arg buffer | format.cpp:101:8:101:13 | buffer | |
78-
| format.cpp:100:24:100:28 | %ls | format.cpp:100:16:100:21 | ref arg buffer | TAINT |
79-
| format.cpp:100:31:100:45 | call to source | format.cpp:100:16:100:21 | ref arg buffer | TAINT |
80-
| format.cpp:104:25:104:28 | {...} | format.cpp:105:17:105:23 | wbuffer | |
81-
| format.cpp:104:25:104:28 | {...} | format.cpp:106:8:106:14 | wbuffer | |
82-
| format.cpp:104:27:104:27 | 0 | format.cpp:104:25:104:28 | {...} | TAINT |
83-
| format.cpp:105:17:105:23 | ref arg wbuffer | format.cpp:106:8:106:14 | wbuffer | |
84-
| format.cpp:105:31:105:35 | %s | format.cpp:105:17:105:23 | ref arg wbuffer | TAINT |
85-
| format.cpp:105:38:105:52 | call to source | format.cpp:105:17:105:23 | ref arg wbuffer | TAINT |
86-
| format.cpp:109:21:109:24 | {...} | format.cpp:110:18:110:23 | buffer | |
87-
| format.cpp:109:21:109:24 | {...} | format.cpp:111:8:111:13 | buffer | |
88-
| format.cpp:109:23:109:23 | 0 | format.cpp:109:21:109:24 | {...} | TAINT |
89-
| format.cpp:110:18:110:23 | ref arg buffer | format.cpp:111:8:111:13 | buffer | |
90-
| format.cpp:115:10:115:11 | 0 | format.cpp:116:29:116:29 | i | |
91-
| format.cpp:115:10:115:11 | 0 | format.cpp:117:8:117:8 | i | |
92-
| format.cpp:116:28:116:29 | ref arg & ... | format.cpp:116:29:116:29 | i [inner post update] | |
93-
| format.cpp:116:28:116:29 | ref arg & ... | format.cpp:117:8:117:8 | i | |
94-
| format.cpp:116:29:116:29 | i | format.cpp:116:28:116:29 | & ... | |
95-
| format.cpp:120:10:120:11 | 0 | format.cpp:121:40:121:40 | i | |
96-
| format.cpp:120:10:120:11 | 0 | format.cpp:122:8:122:8 | i | |
97-
| format.cpp:121:39:121:40 | ref arg & ... | format.cpp:121:40:121:40 | i [inner post update] | |
98-
| format.cpp:121:39:121:40 | ref arg & ... | format.cpp:122:8:122:8 | i | |
99-
| format.cpp:121:40:121:40 | i | format.cpp:121:39:121:40 | & ... | |
100-
| format.cpp:125:21:125:24 | {...} | format.cpp:126:32:126:37 | buffer | |
101-
| format.cpp:125:21:125:24 | {...} | format.cpp:127:8:127:13 | buffer | |
102-
| format.cpp:125:23:125:23 | 0 | format.cpp:125:21:125:24 | {...} | TAINT |
103-
| format.cpp:126:31:126:37 | ref arg & ... | format.cpp:126:32:126:37 | buffer [inner post update] | |
104-
| format.cpp:126:31:126:37 | ref arg & ... | format.cpp:127:8:127:13 | buffer | |
105-
| format.cpp:126:32:126:37 | buffer | format.cpp:126:31:126:37 | & ... | |
106-
| format.cpp:130:21:130:24 | {...} | format.cpp:131:40:131:45 | buffer | |
107-
| format.cpp:130:21:130:24 | {...} | format.cpp:132:8:132:13 | buffer | |
108-
| format.cpp:130:23:130:23 | 0 | format.cpp:130:21:130:24 | {...} | TAINT |
109-
| format.cpp:131:39:131:45 | ref arg & ... | format.cpp:131:40:131:45 | buffer [inner post update] | |
110-
| format.cpp:131:39:131:45 | ref arg & ... | format.cpp:132:8:132:13 | buffer | |
111-
| format.cpp:131:40:131:45 | buffer | format.cpp:131:39:131:45 | & ... | |
6+
| format.cpp:16:21:16:21 | s | format.cpp:22:22:22:22 | s | |
7+
| format.cpp:16:31:16:31 | n | format.cpp:22:25:22:25 | n | |
8+
| format.cpp:16:46:16:51 | format | format.cpp:22:28:22:33 | format | |
9+
| format.cpp:20:10:20:13 | args | format.cpp:22:36:22:39 | args | |
10+
| format.cpp:22:12:22:20 | call to vsnprintf | format.cpp:22:3:22:40 | ... = ... | |
11+
| format.cpp:22:12:22:20 | call to vsnprintf | format.cpp:25:9:25:14 | result | |
12+
| format.cpp:50:21:50:24 | {...} | format.cpp:51:17:51:22 | buffer | |
13+
| format.cpp:50:21:50:24 | {...} | format.cpp:52:8:52:13 | buffer | |
14+
| format.cpp:50:23:50:23 | 0 | format.cpp:50:21:50:24 | {...} | TAINT |
15+
| format.cpp:51:17:51:22 | ref arg buffer | format.cpp:52:8:52:13 | buffer | |
16+
| format.cpp:51:30:51:33 | %s | format.cpp:51:17:51:22 | ref arg buffer | TAINT |
17+
| format.cpp:51:36:51:43 | Hello. | format.cpp:51:17:51:22 | ref arg buffer | TAINT |
18+
| format.cpp:55:21:55:24 | {...} | format.cpp:56:17:56:22 | buffer | |
19+
| format.cpp:55:21:55:24 | {...} | format.cpp:57:8:57:13 | buffer | |
20+
| format.cpp:55:23:55:23 | 0 | format.cpp:55:21:55:24 | {...} | TAINT |
21+
| format.cpp:56:17:56:22 | ref arg buffer | format.cpp:57:8:57:13 | buffer | |
22+
| format.cpp:56:30:56:33 | %s | format.cpp:56:17:56:22 | ref arg buffer | TAINT |
23+
| format.cpp:56:36:56:49 | call to source | format.cpp:56:17:56:22 | ref arg buffer | TAINT |
24+
| format.cpp:60:21:60:24 | {...} | format.cpp:61:17:61:22 | buffer | |
25+
| format.cpp:60:21:60:24 | {...} | format.cpp:62:8:62:13 | buffer | |
26+
| format.cpp:60:23:60:23 | 0 | format.cpp:60:21:60:24 | {...} | TAINT |
27+
| format.cpp:61:17:61:22 | ref arg buffer | format.cpp:62:8:62:13 | buffer | |
28+
| format.cpp:61:30:61:43 | call to source | format.cpp:61:17:61:22 | ref arg buffer | TAINT |
29+
| format.cpp:61:48:61:55 | Hello. | format.cpp:61:17:61:22 | ref arg buffer | TAINT |
30+
| format.cpp:65:21:65:24 | {...} | format.cpp:66:17:66:22 | buffer | |
31+
| format.cpp:65:21:65:24 | {...} | format.cpp:67:8:67:13 | buffer | |
32+
| format.cpp:65:23:65:23 | 0 | format.cpp:65:21:65:24 | {...} | TAINT |
33+
| format.cpp:66:17:66:22 | ref arg buffer | format.cpp:67:8:67:13 | buffer | |
34+
| format.cpp:66:30:66:39 | %s %s %s | format.cpp:66:17:66:22 | ref arg buffer | TAINT |
35+
| format.cpp:66:42:66:44 | a | format.cpp:66:17:66:22 | ref arg buffer | TAINT |
36+
| format.cpp:66:47:66:49 | b | format.cpp:66:17:66:22 | ref arg buffer | TAINT |
37+
| format.cpp:66:52:66:65 | call to source | format.cpp:66:17:66:22 | ref arg buffer | TAINT |
38+
| format.cpp:70:21:70:24 | {...} | format.cpp:71:17:71:22 | buffer | |
39+
| format.cpp:70:21:70:24 | {...} | format.cpp:72:8:72:13 | buffer | |
40+
| format.cpp:70:23:70:23 | 0 | format.cpp:70:21:70:24 | {...} | TAINT |
41+
| format.cpp:71:17:71:22 | ref arg buffer | format.cpp:72:8:72:13 | buffer | |
42+
| format.cpp:71:30:71:35 | %.*s | format.cpp:71:17:71:22 | ref arg buffer | TAINT |
43+
| format.cpp:71:38:71:39 | 10 | format.cpp:71:17:71:22 | ref arg buffer | TAINT |
44+
| format.cpp:71:42:71:55 | call to source | format.cpp:71:17:71:22 | ref arg buffer | TAINT |
45+
| format.cpp:76:21:76:24 | {...} | format.cpp:77:17:77:22 | buffer | |
46+
| format.cpp:76:21:76:24 | {...} | format.cpp:78:8:78:13 | buffer | |
47+
| format.cpp:76:23:76:23 | 0 | format.cpp:76:21:76:24 | {...} | TAINT |
48+
| format.cpp:77:17:77:22 | ref arg buffer | format.cpp:78:8:78:13 | buffer | |
49+
| format.cpp:77:30:77:33 | %i | format.cpp:77:17:77:22 | ref arg buffer | TAINT |
50+
| format.cpp:77:36:77:36 | 0 | format.cpp:77:17:77:22 | ref arg buffer | TAINT |
51+
| format.cpp:81:21:81:24 | {...} | format.cpp:82:17:82:22 | buffer | |
52+
| format.cpp:81:21:81:24 | {...} | format.cpp:83:8:83:13 | buffer | |
53+
| format.cpp:81:23:81:23 | 0 | format.cpp:81:21:81:24 | {...} | TAINT |
54+
| format.cpp:82:17:82:22 | ref arg buffer | format.cpp:83:8:83:13 | buffer | |
55+
| format.cpp:82:30:82:33 | %i | format.cpp:82:17:82:22 | ref arg buffer | TAINT |
56+
| format.cpp:82:36:82:41 | call to source | format.cpp:82:17:82:22 | ref arg buffer | TAINT |
57+
| format.cpp:86:21:86:24 | {...} | format.cpp:87:17:87:22 | buffer | |
58+
| format.cpp:86:21:86:24 | {...} | format.cpp:88:8:88:13 | buffer | |
59+
| format.cpp:86:23:86:23 | 0 | format.cpp:86:21:86:24 | {...} | TAINT |
60+
| format.cpp:87:17:87:22 | ref arg buffer | format.cpp:88:8:88:13 | buffer | |
61+
| format.cpp:87:30:87:35 | %.*s | format.cpp:87:17:87:22 | ref arg buffer | TAINT |
62+
| format.cpp:87:38:87:43 | call to source | format.cpp:87:17:87:22 | ref arg buffer | TAINT |
63+
| format.cpp:87:48:87:55 | Hello. | format.cpp:87:17:87:22 | ref arg buffer | TAINT |
64+
| format.cpp:92:21:92:24 | {...} | format.cpp:93:17:93:22 | buffer | |
65+
| format.cpp:92:21:92:24 | {...} | format.cpp:94:8:94:13 | buffer | |
66+
| format.cpp:92:23:92:23 | 0 | format.cpp:92:21:92:24 | {...} | TAINT |
67+
| format.cpp:93:17:93:22 | ref arg buffer | format.cpp:94:8:94:13 | buffer | |
68+
| format.cpp:93:30:93:33 | %p | format.cpp:93:17:93:22 | ref arg buffer | TAINT |
69+
| format.cpp:93:36:93:49 | call to source | format.cpp:93:17:93:22 | ref arg buffer | TAINT |
70+
| format.cpp:98:21:98:24 | {...} | format.cpp:99:16:99:21 | buffer | |
71+
| format.cpp:98:21:98:24 | {...} | format.cpp:100:8:100:13 | buffer | |
72+
| format.cpp:98:23:98:23 | 0 | format.cpp:98:21:98:24 | {...} | TAINT |
73+
| format.cpp:99:16:99:21 | ref arg buffer | format.cpp:100:8:100:13 | buffer | |
74+
| format.cpp:99:24:99:27 | %s | format.cpp:99:16:99:21 | ref arg buffer | TAINT |
75+
| format.cpp:99:30:99:43 | call to source | format.cpp:99:16:99:21 | ref arg buffer | TAINT |
76+
| format.cpp:103:21:103:24 | {...} | format.cpp:104:16:104:21 | buffer | |
77+
| format.cpp:103:21:103:24 | {...} | format.cpp:105:8:105:13 | buffer | |
78+
| format.cpp:103:23:103:23 | 0 | format.cpp:103:21:103:24 | {...} | TAINT |
79+
| format.cpp:104:16:104:21 | ref arg buffer | format.cpp:105:8:105:13 | buffer | |
80+
| format.cpp:104:24:104:28 | %ls | format.cpp:104:16:104:21 | ref arg buffer | TAINT |
81+
| format.cpp:104:31:104:45 | call to source | format.cpp:104:16:104:21 | ref arg buffer | TAINT |
82+
| format.cpp:108:25:108:28 | {...} | format.cpp:109:17:109:23 | wbuffer | |
83+
| format.cpp:108:25:108:28 | {...} | format.cpp:110:8:110:14 | wbuffer | |
84+
| format.cpp:108:27:108:27 | 0 | format.cpp:108:25:108:28 | {...} | TAINT |
85+
| format.cpp:109:17:109:23 | ref arg wbuffer | format.cpp:110:8:110:14 | wbuffer | |
86+
| format.cpp:109:31:109:35 | %s | format.cpp:109:17:109:23 | ref arg wbuffer | TAINT |
87+
| format.cpp:109:38:109:52 | call to source | format.cpp:109:17:109:23 | ref arg wbuffer | TAINT |
88+
| format.cpp:113:21:113:24 | {...} | format.cpp:114:18:114:23 | buffer | |
89+
| format.cpp:113:21:113:24 | {...} | format.cpp:115:8:115:13 | buffer | |
90+
| format.cpp:113:23:113:23 | 0 | format.cpp:113:21:113:24 | {...} | TAINT |
91+
| format.cpp:114:18:114:23 | ref arg buffer | format.cpp:115:8:115:13 | buffer | |
92+
| format.cpp:119:10:119:11 | 0 | format.cpp:120:29:120:29 | i | |
93+
| format.cpp:119:10:119:11 | 0 | format.cpp:121:8:121:8 | i | |
94+
| format.cpp:120:28:120:29 | ref arg & ... | format.cpp:120:29:120:29 | i [inner post update] | |
95+
| format.cpp:120:28:120:29 | ref arg & ... | format.cpp:121:8:121:8 | i | |
96+
| format.cpp:120:29:120:29 | i | format.cpp:120:28:120:29 | & ... | |
97+
| format.cpp:124:10:124:11 | 0 | format.cpp:125:40:125:40 | i | |
98+
| format.cpp:124:10:124:11 | 0 | format.cpp:126:8:126:8 | i | |
99+
| format.cpp:125:39:125:40 | ref arg & ... | format.cpp:125:40:125:40 | i [inner post update] | |
100+
| format.cpp:125:39:125:40 | ref arg & ... | format.cpp:126:8:126:8 | i | |
101+
| format.cpp:125:40:125:40 | i | format.cpp:125:39:125:40 | & ... | |
102+
| format.cpp:129:21:129:24 | {...} | format.cpp:130:32:130:37 | buffer | |
103+
| format.cpp:129:21:129:24 | {...} | format.cpp:131:8:131:13 | buffer | |
104+
| format.cpp:129:23:129:23 | 0 | format.cpp:129:21:129:24 | {...} | TAINT |
105+
| format.cpp:130:31:130:37 | ref arg & ... | format.cpp:130:32:130:37 | buffer [inner post update] | |
106+
| format.cpp:130:31:130:37 | ref arg & ... | format.cpp:131:8:131:13 | buffer | |
107+
| format.cpp:130:32:130:37 | buffer | format.cpp:130:31:130:37 | & ... | |
108+
| format.cpp:134:21:134:24 | {...} | format.cpp:135:40:135:45 | buffer | |
109+
| format.cpp:134:21:134:24 | {...} | format.cpp:136:8:136:13 | buffer | |
110+
| format.cpp:134:23:134:23 | 0 | format.cpp:134:21:134:24 | {...} | TAINT |
111+
| format.cpp:135:39:135:45 | ref arg & ... | format.cpp:135:40:135:45 | buffer [inner post update] | |
112+
| format.cpp:135:39:135:45 | ref arg & ... | format.cpp:136:8:136:13 | buffer | |
113+
| format.cpp:135:40:135:45 | buffer | format.cpp:135:39:135:45 | & ... | |
112114
| stl.cpp:67:12:67:17 | call to source | stl.cpp:71:7:71:7 | a | |
113115
| stl.cpp:68:16:68:20 | 123 | stl.cpp:68:16:68:21 | call to basic_string | TAINT |
114116
| stl.cpp:68:16:68:21 | call to basic_string | stl.cpp:72:7:72:7 | b | |

cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
| format.cpp:53:8:53:13 | buffer | format.cpp:52:36:52:49 | call to source |
2-
| format.cpp:58:8:58:13 | buffer | format.cpp:57:30:57:43 | call to source |
3-
| format.cpp:63:8:63:13 | buffer | format.cpp:62:52:62:65 | call to source |
4-
| format.cpp:68:8:68:13 | buffer | format.cpp:67:42:67:55 | call to source |
5-
| format.cpp:79:8:79:13 | buffer | format.cpp:78:36:78:41 | call to source |
6-
| format.cpp:84:8:84:13 | buffer | format.cpp:83:38:83:43 | call to source |
7-
| format.cpp:90:8:90:13 | buffer | format.cpp:89:36:89:49 | call to source |
8-
| format.cpp:96:8:96:13 | buffer | format.cpp:95:30:95:43 | call to source |
9-
| format.cpp:101:8:101:13 | buffer | format.cpp:100:31:100:45 | call to source |
10-
| format.cpp:106:8:106:14 | wbuffer | format.cpp:105:38:105:52 | call to source |
1+
| format.cpp:57:8:57:13 | buffer | format.cpp:56:36:56:49 | call to source |
2+
| format.cpp:62:8:62:13 | buffer | format.cpp:61:30:61:43 | call to source |
3+
| format.cpp:67:8:67:13 | buffer | format.cpp:66:52:66:65 | call to source |
4+
| format.cpp:72:8:72:13 | buffer | format.cpp:71:42:71:55 | call to source |
5+
| format.cpp:83:8:83:13 | buffer | format.cpp:82:36:82:41 | call to source |
6+
| format.cpp:88:8:88:13 | buffer | format.cpp:87:38:87:43 | call to source |
7+
| format.cpp:94:8:94:13 | buffer | format.cpp:93:36:93:49 | call to source |
8+
| format.cpp:100:8:100:13 | buffer | format.cpp:99:30:99:43 | call to source |
9+
| format.cpp:105:8:105:13 | buffer | format.cpp:104:31:104:45 | call to source |
10+
| format.cpp:110:8:110:14 | wbuffer | format.cpp:109:38:109:52 | call to source |
1111
| stl.cpp:71:7:71:7 | a | stl.cpp:67:12:67:17 | call to source |
1212
| stl.cpp:73:7:73:7 | c | stl.cpp:69:16:69:21 | call to source |
1313
| stl.cpp:75:9:75:13 | call to c_str | stl.cpp:69:16:69:21 | call to source |

0 commit comments

Comments
 (0)