Skip to content

Commit ef3ceb5

Browse files
committed
CPP: Don't use getFollowingStmt.
1 parent 536adaa commit ef3ceb5

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cpp/ql/src/semmle/code/cpp/controlflow/LocalScopeVariableReachability.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private predicate bbLoopConditionAlwaysTrueUponEntrySuccessor(BasicBlock pred, B
143143
loopConditionAlwaysTrueUponEntry(loop, _) and
144144
(
145145
(
146-
succ = loop.(Loop).getFollowingStmt() and
146+
not succ = loop.(Loop).getStmt() and
147147
pred.getAFalseSuccessor() = succ and
148148
skipsLoop = true
149149
) or (

cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
| test.cpp:336:10:336:10 | a | The variable $@ may not be initialized here. | test.cpp:333:7:333:7 | a | a |
1313
| test.cpp:369:10:369:10 | a | The variable $@ may not be initialized here. | test.cpp:358:7:358:7 | a | a |
1414
| test.cpp:378:9:378:11 | val | The variable $@ may not be initialized here. | test.cpp:359:6:359:8 | val | val |
15-
| test.cpp:410:9:410:11 | val | The variable $@ may not be initialized here. | test.cpp:401:6:401:8 | val | val |
1615
| test.cpp:417:10:417:10 | j | The variable $@ may not be initialized here. | test.cpp:414:9:414:9 | j | j |
1716
| test.cpp:436:9:436:9 | j | The variable $@ may not be initialized here. | test.cpp:431:9:431:9 | j | j |

cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ int test34() {
407407
loop = false;
408408
}
409409
}
410-
return val; // GOOD [FALSE POSITIVE]
410+
return val; // GOOD
411411
}
412412

413413
int test35() {

0 commit comments

Comments
 (0)