Skip to content

Commit f7c55a3

Browse files
authored
Merge pull request github#11202 from jketema/fix-accept-prototype
C++: Fix the `accept` prototype in the dataflow taint tests
2 parents 30bbae3 + 62f5d10 commit f7c55a3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct sockaddr {
99
char* sa_data;
1010
};
1111

12-
int accept(int, const sockaddr*, int*);
12+
int accept(int, sockaddr*, int*);
1313

1414
void sink(sockaddr);
1515

@@ -20,5 +20,5 @@ void test_accept() {
2020
int a = accept(s, &addr, &size);
2121

2222
sink(a); // $ ast=17:11 ir SPURIOUS: ast=18:12
23-
sink(addr); // $ ast,ir
23+
sink(addr); // $ ast=17:11 ir SPURIOUS: ast=18:12
2424
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@
142142
| bsd.cpp:19:14:19:29 | sizeof(sockaddr) | bsd.cpp:20:29:20:32 | size | |
143143
| bsd.cpp:20:11:20:16 | call to accept | bsd.cpp:22:8:22:8 | a | |
144144
| bsd.cpp:20:18:20:18 | s | bsd.cpp:20:11:20:16 | call to accept | TAINT |
145+
| bsd.cpp:20:18:20:18 | s | bsd.cpp:20:21:20:25 | ref arg & ... | TAINT |
145146
| bsd.cpp:20:21:20:25 | & ... | bsd.cpp:20:11:20:16 | call to accept | TAINT |
147+
| bsd.cpp:20:21:20:25 | & ... | bsd.cpp:20:21:20:25 | ref arg & ... | TAINT |
148+
| bsd.cpp:20:21:20:25 | ref arg & ... | bsd.cpp:20:22:20:25 | addr [inner post update] | |
149+
| bsd.cpp:20:21:20:25 | ref arg & ... | bsd.cpp:23:8:23:11 | addr | |
146150
| bsd.cpp:20:22:20:25 | addr | bsd.cpp:20:11:20:16 | call to accept | TAINT |
147151
| bsd.cpp:20:22:20:25 | addr | bsd.cpp:20:21:20:25 | & ... | |
152+
| bsd.cpp:20:22:20:25 | addr | bsd.cpp:20:21:20:25 | ref arg & ... | TAINT |
148153
| bsd.cpp:20:28:20:32 | ref arg & ... | bsd.cpp:20:29:20:32 | size [inner post update] | |
149154
| bsd.cpp:20:29:20:32 | size | bsd.cpp:20:28:20:32 | & ... | |
150155
| constructor_delegation.cpp:8:2:8:8 | this | constructor_delegation.cpp:8:20:8:24 | constructor init of field x [pre-this] | |

0 commit comments

Comments
 (0)