Skip to content

Commit b38a9d5

Browse files
committed
C++: Effect of 'Don't override getParameterSizeIndex in the model for Accept'...
1 parent 13eb9e0 commit b38a9d5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-114/semmle/UncontrolledProcessOperation/UncontrolledProcessOperation.expected

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ edges
3939
| test.cpp:98:17:98:22 | buffer | test.cpp:99:15:99:20 | buffer |
4040
| test.cpp:98:17:98:22 | recv output argument | test.cpp:99:15:99:20 | (const char *)... |
4141
| test.cpp:98:17:98:22 | recv output argument | test.cpp:99:15:99:20 | buffer |
42+
| test.cpp:106:17:106:22 | buffer | test.cpp:107:15:107:20 | (const char *)... |
43+
| test.cpp:106:17:106:22 | buffer | test.cpp:107:15:107:20 | buffer |
44+
| test.cpp:106:17:106:22 | recv output argument | test.cpp:107:15:107:20 | (const char *)... |
45+
| test.cpp:106:17:106:22 | recv output argument | test.cpp:107:15:107:20 | buffer |
4246
nodes
4347
| test.cpp:24:30:24:36 | *command | semmle.label | *command |
4448
| test.cpp:24:30:24:36 | command | semmle.label | command |
@@ -79,6 +83,11 @@ nodes
7983
| test.cpp:99:15:99:20 | (const char *)... | semmle.label | (const char *)... |
8084
| test.cpp:99:15:99:20 | (const char *)... | semmle.label | (const char *)... |
8185
| test.cpp:99:15:99:20 | buffer | semmle.label | buffer |
86+
| test.cpp:106:17:106:22 | buffer | semmle.label | buffer |
87+
| test.cpp:106:17:106:22 | recv output argument | semmle.label | recv output argument |
88+
| test.cpp:107:15:107:20 | (const char *)... | semmle.label | (const char *)... |
89+
| test.cpp:107:15:107:20 | (const char *)... | semmle.label | (const char *)... |
90+
| test.cpp:107:15:107:20 | buffer | semmle.label | buffer |
8291
#select
8392
| test.cpp:26:10:26:16 | command | test.cpp:42:18:42:23 | call to getenv | test.cpp:26:10:26:16 | command | The value of this argument may come from $@ and is being passed to system | test.cpp:42:18:42:23 | call to getenv | call to getenv |
8493
| test.cpp:31:10:31:16 | command | test.cpp:43:18:43:23 | call to getenv | test.cpp:31:10:31:16 | command | The value of this argument may come from $@ and is being passed to system | test.cpp:43:18:43:23 | call to getenv | call to getenv |
@@ -87,3 +96,4 @@ nodes
8796
| test.cpp:78:10:78:15 | buffer | test.cpp:76:12:76:17 | buffer | test.cpp:78:10:78:15 | buffer | The value of this argument may come from $@ and is being passed to system | test.cpp:76:12:76:17 | buffer | buffer |
8897
| test.cpp:79:10:79:13 | data | test.cpp:76:12:76:17 | buffer | test.cpp:79:10:79:13 | data | The value of this argument may come from $@ and is being passed to system | test.cpp:76:12:76:17 | buffer | buffer |
8998
| test.cpp:99:15:99:20 | buffer | test.cpp:98:17:98:22 | buffer | test.cpp:99:15:99:20 | buffer | The value of this argument may come from $@ and is being passed to LoadLibrary | test.cpp:98:17:98:22 | buffer | buffer |
99+
| test.cpp:107:15:107:20 | buffer | test.cpp:106:17:106:22 | buffer | test.cpp:107:15:107:20 | buffer | The value of this argument may come from $@ and is being passed to LoadLibrary | test.cpp:106:17:106:22 | buffer | buffer |

cpp/ql/test/query-tests/Security/CWE/CWE-114/semmle/UncontrolledProcessOperation/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ void testAcceptRecv(int socket1, int socket2)
104104

105105
accept(socket2, 0, 0);
106106
recv(socket2, buffer, 1024);
107-
LoadLibrary(buffer); // BAD: using data from recv [NOT DETECTED]
107+
LoadLibrary(buffer); // BAD: using data from recv
108108
}
109109
}

0 commit comments

Comments
 (0)