Skip to content

Commit 9d539a3

Browse files
committed
Address copilot review
1 parent 8e8feef commit 9d539a3

File tree

9 files changed

+6
-10
lines changed

9 files changed

+6
-10
lines changed

.github/workflows/codeql_unit_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on:
1515
- main
1616
- next
1717
- "rc/**"
18-
- michaelrfairhurst/package-undefined-behavior
1918

2019
jobs:
2120

.github/workflows/extra-rule-validation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on:
1515
- main
1616
- "rc/**"
1717
- next
18-
- michaelrfairhurst/package-undefined-behavior
1918

2019

2120
jobs:

.github/workflows/tooling-unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on:
1515
- main
1616
- "rc/**"
1717
- next
18-
- michaelrfairhurst/package-undefined-behavior
1918

2019
jobs:
2120
prepare-supported-codeql-env-matrix:

.github/workflows/validate-package-files.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- main
1010
- next
1111
- "rc/**"
12-
- michaelrfairhurst/package-undefined-behavior
1312

1413
jobs:
1514
validate-package-files:

.github/workflows/validate-query-help.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- main
1010
- next
1111
- "rc/**"
12-
- michaelrfairhurst/package-undefined-behavior
1312

1413
jobs:
1514
validate-query-help-files:

.github/workflows/validate-query-test-case-formatting.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- main
1010
- next
1111
- "rc/**"
12-
- michaelrfairhurst/package-undefined-behavior
1312

1413
env:
1514
XARGS_MAX_PROCS: 4

cpp/common/src/codingstandards/cpp/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module PossibleDataRaceBetweenThreadsShared<PossibleDataRaceBetweenThreadsShared
3737
TStdFunctionCall(FunctionCall call) {
3838
call.getTarget()
3939
.hasName([
40-
"setlocale", "tmpnam", "rand", "srand", "getenv", "getenv_s", "strok", "strerror",
40+
"setlocale", "tmpnam", "rand", "srand", "getenv", "getenv_s", "strtok", "strerror",
4141
"asctime", "ctime", "gmtime", "localtime", "mbrtoc16", "c16rtomb", "mbrtoc32",
4242
"c32rtomb", "mbrlen", "mbrtowc", "wcrtomb", "mbsrtowcs", "wcsrtombs"
4343
])

cpp/common/test/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
| test.cpp:93:3:93:6 | call to rand | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:93:3:93:6 | call to rand | rand | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:93:3:93:6 | call to rand | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
99
| test.cpp:94:3:94:11 | call to rand | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:94:3:94:11 | call to rand | rand | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:94:3:94:11 | call to rand | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1010
| test.cpp:96:3:96:8 | call to getenv | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:96:3:96:8 | call to getenv | getenv | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:96:3:96:8 | call to getenv | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
11+
| test.cpp:99:3:99:8 | call to strtok | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:99:3:99:8 | call to strtok | strtok | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:99:3:99:8 | call to strtok | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
12+
| test.cpp:100:3:100:13 | call to strtok | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:100:3:100:13 | call to strtok | strtok | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:100:3:100:13 | call to strtok | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1113
| test.cpp:101:3:101:10 | call to strerror | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:101:3:101:10 | call to strerror | strerror | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:101:3:101:10 | call to strerror | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1214
| test.cpp:102:3:102:15 | call to strerror | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:102:3:102:15 | call to strerror | strerror | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:102:3:102:15 | call to strerror | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1315
| test.cpp:103:3:103:9 | call to asctime | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:103:3:103:9 | call to asctime | asctime | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:103:3:103:9 | call to asctime | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |

cpp/common/test/rules/possibledataracebetweenthreadsshared/test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ void many_thread13_calls_nonreentrant_funcs(void *p) {
8989
// Not all are defined in std:: in our stubs.
9090
std::setlocale(LC_ALL, "C"); // NON-COMPLIANT
9191
setlocale(LC_ALL, "C"); // NON-COMPLIANT
92-
std::tmpnam(""); // NON-COMPLIANT
92+
std::tmpnam(nullptr); // NON-COMPLIANT
9393
rand(); // NON-COMPLIANT
9494
std::rand(); // NON-COMPLIANT
9595
// srand(0); // NON-COMPLIANT
9696
getenv("PATH"); // NON-COMPLIANT
9797
// std::getenv("PATH"); // NON-COMPLIANT
9898
////getenv_s(NULL, NULL, 0, NULL); // NON-COMPLIANT
99-
strtok("a", "b"); // NON-COMPLIANT[False negative]
100-
std::strtok("a", "b"); // NON-COMPLIANT[False negative]
99+
strtok("a", "b"); // NON-COMPLIANT
100+
std::strtok("a", "b"); // NON-COMPLIANT
101101
strerror(0); // NON-COMPLIANT
102102
std::strerror(0); // NON-COMPLIANT
103103
asctime(NULL); // NON-COMPLIANT

0 commit comments

Comments
 (0)