We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 136ecaf commit 5101a8eCopy full SHA for 5101a8e
java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.java
@@ -1,11 +1,11 @@
1
class SleepTest {
2
public void test(int userSuppliedWaitTime) throws Exception {
3
// BAD: no boundary check on wait time
4
- Thread.sleep(waitTime);
+ Thread.sleep(userSuppliedWaitTime);
5
6
// GOOD: enforce an upper limit on wait time
7
- if (waitTime > 0 && waitTime < 5000) {
8
+ if (userSuppliedWaitTime > 0 && userSuppliedWaitTime < 5000) {
9
}
10
11
0 commit comments