Skip to content

Commit 2d4a2e0

Browse files
committed
C++: Test spacing.
1 parent 6b1ac73 commit 2d4a2e0

File tree

2 files changed

+52
-46
lines changed

2 files changed

+52
-46
lines changed
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
edges
2-
| test3.cpp:68:21:68:29 | password1 | test3.cpp:70:15:70:17 | ptr |
3-
| test3.cpp:75:15:75:22 | password | test3.cpp:77:15:77:17 | ptr |
4-
| test3.cpp:106:20:106:25 | buffer | test3.cpp:108:14:108:19 | buffer |
5-
| test3.cpp:111:28:111:33 | buffer | test3.cpp:113:9:113:14 | buffer |
6-
| test3.cpp:120:9:120:23 | global_password | test3.cpp:138:16:138:29 | call to get_global_str |
7-
| test3.cpp:128:11:128:18 | password | test3.cpp:106:20:106:25 | buffer |
8-
| test3.cpp:132:21:132:22 | call to id | test3.cpp:134:15:134:17 | ptr |
9-
| test3.cpp:132:24:132:32 | password1 | test3.cpp:111:28:111:33 | buffer |
10-
| test3.cpp:132:24:132:32 | password1 | test3.cpp:132:21:132:22 | call to id |
11-
| test3.cpp:138:16:138:29 | call to get_global_str | test3.cpp:140:15:140:18 | data |
12-
| test3.cpp:151:19:151:26 | password | test3.cpp:153:15:153:20 | buffer |
2+
| test3.cpp:74:21:74:29 | password1 | test3.cpp:76:15:76:17 | ptr |
3+
| test3.cpp:81:15:81:22 | password | test3.cpp:83:15:83:17 | ptr |
4+
| test3.cpp:112:20:112:25 | buffer | test3.cpp:114:14:114:19 | buffer |
5+
| test3.cpp:117:28:117:33 | buffer | test3.cpp:119:9:119:14 | buffer |
6+
| test3.cpp:126:9:126:23 | global_password | test3.cpp:144:16:144:29 | call to get_global_str |
7+
| test3.cpp:134:11:134:18 | password | test3.cpp:112:20:112:25 | buffer |
8+
| test3.cpp:138:21:138:22 | call to id | test3.cpp:140:15:140:17 | ptr |
9+
| test3.cpp:138:24:138:32 | password1 | test3.cpp:117:28:117:33 | buffer |
10+
| test3.cpp:138:24:138:32 | password1 | test3.cpp:138:21:138:22 | call to id |
11+
| test3.cpp:144:16:144:29 | call to get_global_str | test3.cpp:146:15:146:18 | data |
12+
| test3.cpp:157:19:157:26 | password | test3.cpp:159:15:159:20 | buffer |
1313
nodes
14-
| test3.cpp:20:15:20:23 | password1 | semmle.label | password1 |
15-
| test3.cpp:24:15:24:23 | password2 | semmle.label | password2 |
16-
| test3.cpp:41:15:41:22 | password | semmle.label | password |
17-
| test3.cpp:49:15:49:22 | password | semmle.label | password |
18-
| test3.cpp:68:21:68:29 | password1 | semmle.label | password1 |
19-
| test3.cpp:70:15:70:17 | ptr | semmle.label | ptr |
20-
| test3.cpp:75:15:75:22 | password | semmle.label | password |
21-
| test3.cpp:77:15:77:17 | ptr | semmle.label | ptr |
22-
| test3.cpp:95:12:95:19 | password | semmle.label | password |
23-
| test3.cpp:106:20:106:25 | buffer | semmle.label | buffer |
24-
| test3.cpp:108:14:108:19 | buffer | semmle.label | buffer |
25-
| test3.cpp:111:28:111:33 | buffer | semmle.label | buffer |
26-
| test3.cpp:113:9:113:14 | buffer | semmle.label | buffer |
27-
| test3.cpp:120:9:120:23 | global_password | semmle.label | global_password |
28-
| test3.cpp:128:11:128:18 | password | semmle.label | password |
29-
| test3.cpp:132:21:132:22 | call to id | semmle.label | call to id |
30-
| test3.cpp:132:24:132:32 | password1 | semmle.label | password1 |
31-
| test3.cpp:134:15:134:17 | ptr | semmle.label | ptr |
32-
| test3.cpp:138:16:138:29 | call to get_global_str | semmle.label | call to get_global_str |
33-
| test3.cpp:140:15:140:18 | data | semmle.label | data |
34-
| test3.cpp:151:19:151:26 | password | semmle.label | password |
35-
| test3.cpp:153:15:153:20 | buffer | semmle.label | buffer |
14+
| test3.cpp:22:15:22:23 | password1 | semmle.label | password1 |
15+
| test3.cpp:26:15:26:23 | password2 | semmle.label | password2 |
16+
| test3.cpp:47:15:47:22 | password | semmle.label | password |
17+
| test3.cpp:55:15:55:22 | password | semmle.label | password |
18+
| test3.cpp:74:21:74:29 | password1 | semmle.label | password1 |
19+
| test3.cpp:76:15:76:17 | ptr | semmle.label | ptr |
20+
| test3.cpp:81:15:81:22 | password | semmle.label | password |
21+
| test3.cpp:83:15:83:17 | ptr | semmle.label | ptr |
22+
| test3.cpp:101:12:101:19 | password | semmle.label | password |
23+
| test3.cpp:112:20:112:25 | buffer | semmle.label | buffer |
24+
| test3.cpp:114:14:114:19 | buffer | semmle.label | buffer |
25+
| test3.cpp:117:28:117:33 | buffer | semmle.label | buffer |
26+
| test3.cpp:119:9:119:14 | buffer | semmle.label | buffer |
27+
| test3.cpp:126:9:126:23 | global_password | semmle.label | global_password |
28+
| test3.cpp:134:11:134:18 | password | semmle.label | password |
29+
| test3.cpp:138:21:138:22 | call to id | semmle.label | call to id |
30+
| test3.cpp:138:24:138:32 | password1 | semmle.label | password1 |
31+
| test3.cpp:140:15:140:17 | ptr | semmle.label | ptr |
32+
| test3.cpp:144:16:144:29 | call to get_global_str | semmle.label | call to get_global_str |
33+
| test3.cpp:146:15:146:18 | data | semmle.label | data |
34+
| test3.cpp:157:19:157:26 | password | semmle.label | password |
35+
| test3.cpp:159:15:159:20 | buffer | semmle.label | buffer |
3636
subpaths
37-
| test3.cpp:132:24:132:32 | password1 | test3.cpp:111:28:111:33 | buffer | test3.cpp:113:9:113:14 | buffer | test3.cpp:132:21:132:22 | call to id |
37+
| test3.cpp:138:24:138:32 | password1 | test3.cpp:117:28:117:33 | buffer | test3.cpp:119:9:119:14 | buffer | test3.cpp:138:21:138:22 | call to id |
3838
#select
39-
| test3.cpp:20:3:20:6 | call to send | test3.cpp:20:15:20:23 | password1 | test3.cpp:20:15:20:23 | password1 | This operation transmits 'password1', which may contain unencrypted sensitive data from $@ | test3.cpp:20:15:20:23 | password1 | password1 |
40-
| test3.cpp:24:3:24:6 | call to send | test3.cpp:24:15:24:23 | password2 | test3.cpp:24:15:24:23 | password2 | This operation transmits 'password2', which may contain unencrypted sensitive data from $@ | test3.cpp:24:15:24:23 | password2 | password2 |
41-
| test3.cpp:41:3:41:6 | call to recv | test3.cpp:41:15:41:22 | password | test3.cpp:41:15:41:22 | password | This operation receives into 'password', which may put unencrypted sensitive data into $@ | test3.cpp:41:15:41:22 | password | password |
42-
| test3.cpp:49:3:49:6 | call to recv | test3.cpp:49:15:49:22 | password | test3.cpp:49:15:49:22 | password | This operation receives into 'password', which may put unencrypted sensitive data into $@ | test3.cpp:49:15:49:22 | password | password |
43-
| test3.cpp:70:3:70:6 | call to send | test3.cpp:68:21:68:29 | password1 | test3.cpp:70:15:70:17 | ptr | This operation transmits 'ptr', which may contain unencrypted sensitive data from $@ | test3.cpp:68:21:68:29 | password1 | password1 |
44-
| test3.cpp:77:3:77:6 | call to recv | test3.cpp:75:15:75:22 | password | test3.cpp:77:15:77:17 | ptr | This operation receives into 'ptr', which may put unencrypted sensitive data into $@ | test3.cpp:75:15:75:22 | password | password |
45-
| test3.cpp:95:3:95:6 | call to read | test3.cpp:95:12:95:19 | password | test3.cpp:95:12:95:19 | password | This operation receives into 'password', which may put unencrypted sensitive data into $@ | test3.cpp:95:12:95:19 | password | password |
46-
| test3.cpp:108:2:108:5 | call to recv | test3.cpp:128:11:128:18 | password | test3.cpp:108:14:108:19 | buffer | This operation receives into 'buffer', which may put unencrypted sensitive data into $@ | test3.cpp:128:11:128:18 | password | password |
47-
| test3.cpp:134:3:134:6 | call to send | test3.cpp:132:24:132:32 | password1 | test3.cpp:134:15:134:17 | ptr | This operation transmits 'ptr', which may contain unencrypted sensitive data from $@ | test3.cpp:132:24:132:32 | password1 | password1 |
48-
| test3.cpp:140:3:140:6 | call to send | test3.cpp:120:9:120:23 | global_password | test3.cpp:140:15:140:18 | data | This operation transmits 'data', which may contain unencrypted sensitive data from $@ | test3.cpp:120:9:120:23 | global_password | global_password |
49-
| test3.cpp:153:3:153:6 | call to send | test3.cpp:151:19:151:26 | password | test3.cpp:153:15:153:20 | buffer | This operation transmits 'buffer', which may contain unencrypted sensitive data from $@ | test3.cpp:151:19:151:26 | password | password |
39+
| test3.cpp:22:3:22:6 | call to send | test3.cpp:22:15:22:23 | password1 | test3.cpp:22:15:22:23 | password1 | This operation transmits 'password1', which may contain unencrypted sensitive data from $@ | test3.cpp:22:15:22:23 | password1 | password1 |
40+
| test3.cpp:26:3:26:6 | call to send | test3.cpp:26:15:26:23 | password2 | test3.cpp:26:15:26:23 | password2 | This operation transmits 'password2', which may contain unencrypted sensitive data from $@ | test3.cpp:26:15:26:23 | password2 | password2 |
41+
| test3.cpp:47:3:47:6 | call to recv | test3.cpp:47:15:47:22 | password | test3.cpp:47:15:47:22 | password | This operation receives into 'password', which may put unencrypted sensitive data into $@ | test3.cpp:47:15:47:22 | password | password |
42+
| test3.cpp:55:3:55:6 | call to recv | test3.cpp:55:15:55:22 | password | test3.cpp:55:15:55:22 | password | This operation receives into 'password', which may put unencrypted sensitive data into $@ | test3.cpp:55:15:55:22 | password | password |
43+
| test3.cpp:76:3:76:6 | call to send | test3.cpp:74:21:74:29 | password1 | test3.cpp:76:15:76:17 | ptr | This operation transmits 'ptr', which may contain unencrypted sensitive data from $@ | test3.cpp:74:21:74:29 | password1 | password1 |
44+
| test3.cpp:83:3:83:6 | call to recv | test3.cpp:81:15:81:22 | password | test3.cpp:83:15:83:17 | ptr | This operation receives into 'ptr', which may put unencrypted sensitive data into $@ | test3.cpp:81:15:81:22 | password | password |
45+
| test3.cpp:101:3:101:6 | call to read | test3.cpp:101:12:101:19 | password | test3.cpp:101:12:101:19 | password | This operation receives into 'password', which may put unencrypted sensitive data into $@ | test3.cpp:101:12:101:19 | password | password |
46+
| test3.cpp:114:2:114:5 | call to recv | test3.cpp:134:11:134:18 | password | test3.cpp:114:14:114:19 | buffer | This operation receives into 'buffer', which may put unencrypted sensitive data into $@ | test3.cpp:134:11:134:18 | password | password |
47+
| test3.cpp:140:3:140:6 | call to send | test3.cpp:138:24:138:32 | password1 | test3.cpp:140:15:140:17 | ptr | This operation transmits 'ptr', which may contain unencrypted sensitive data from $@ | test3.cpp:138:24:138:32 | password1 | password1 |
48+
| test3.cpp:146:3:146:6 | call to send | test3.cpp:126:9:126:23 | global_password | test3.cpp:146:15:146:18 | data | This operation transmits 'data', which may contain unencrypted sensitive data from $@ | test3.cpp:126:9:126:23 | global_password | global_password |
49+
| test3.cpp:159:3:159:6 | call to send | test3.cpp:157:19:157:26 | password | test3.cpp:159:15:159:20 | buffer | This operation transmits 'buffer', which may contain unencrypted sensitive data from $@ | test3.cpp:157:19:157:26 | password | password |

cpp/ql/test/query-tests/Security/CWE/CWE-311/semmle/tests/test3.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
typedef unsigned long size_t;
33
#define STDIN_FILENO (0)
44

5+
6+
57
size_t strlen(const char *s);
68

79
void send(int fd, const void *buf, size_t bufLen, int d);
@@ -31,6 +33,10 @@ void test_send(const char *password1, const char *password2, const char *passwor
3133
{
3234
send(val(), message, strlen(message), val()); // GOOD: `message` is not a password
3335
}
36+
37+
38+
39+
3440
}
3541

3642
void test_receive()
@@ -125,7 +131,7 @@ void test_interprocedural(const char *password1)
125131
{
126132
char password[256];
127133

128-
my_recv(password, 256); // BAD: `password` is received plaintext [detected on line 108]
134+
my_recv(password, 256); // BAD: `password` is received plaintext [detected in `my_recv`]
129135
}
130136

131137
{

0 commit comments

Comments
 (0)