Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70e4a40

Browse files
committed
C++: Add the new query to tests.
1 parent d95b56f commit 70e4a40

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
edges
2+
| tests.c:57:21:57:28 | array to pointer conversion | tests.c:70:70:70:77 | array to pointer conversion |
3+
| tests.c:57:21:57:28 | password | tests.c:70:70:70:77 | array to pointer conversion |
4+
nodes
5+
| tests.c:57:21:57:28 | array to pointer conversion | semmle.label | array to pointer conversion |
6+
| tests.c:57:21:57:28 | password | semmle.label | password |
7+
| tests.c:70:70:70:77 | array to pointer conversion | semmle.label | array to pointer conversion |
8+
subpaths
9+
#select
10+
| tests.c:70:70:70:77 | array to pointer conversion | tests.c:57:21:57:28 | array to pointer conversion | tests.c:70:70:70:77 | array to pointer conversion | This operation potentially exposes sensitive system data (a password or token) from $@. | tests.c:57:21:57:28 | array to pointer conversion | array to pointer conversion |
11+
| tests.c:70:70:70:77 | array to pointer conversion | tests.c:57:21:57:28 | password | tests.c:70:70:70:77 | array to pointer conversion | This operation potentially exposes sensitive system data (a password or token) from $@. | tests.c:57:21:57:28 | password | password |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Security/CWE/CWE-497/PotentiallyExposedSystemData.ql

cpp/ql/test/query-tests/Security/CWE/CWE-497/SAMATE/tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ void CWE535_Info_Exposure_Shell_Error__w32_char_01_bad()
6767
printLine("Unable to login.");
6868
}
6969
/* FLAW: Write sensitive data to stderr */
70-
fprintf(stderr, "User attempted access with password: %s\n", password); // [NOT DETECTED]
70+
fprintf(stderr, "User attempted access with password: %s\n", password);
7171
}
7272
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
edges
2+
nodes
3+
subpaths
4+
#select
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Security/CWE/CWE-497/PotentiallyExposedSystemData.ql

0 commit comments

Comments
 (0)