Skip to content

Commit d2f5734

Browse files
committed
C++: Add FP.
1 parent 30abc95 commit d2f5734

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ nodes
1313
| test.cpp:458:6:458:6 | definition of x | semmle.label | definition of x |
1414
| test.cpp:464:6:464:6 | definition of x | semmle.label | definition of x |
1515
| test.cpp:471:6:471:6 | definition of x | semmle.label | definition of x |
16+
| test.cpp:592:6:592:8 | definition of quo | semmle.label | definition of quo |
1617
#select
1718
| test.cpp:12:6:12:8 | foo | test.cpp:11:6:11:8 | definition of foo | test.cpp:11:6:11:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:11:6:11:8 | foo | foo |
1819
| test.cpp:113:6:113:8 | foo | test.cpp:111:6:111:8 | definition of foo | test.cpp:111:6:111:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:111:6:111:8 | foo | foo |
@@ -27,3 +28,4 @@ nodes
2728
| test.cpp:460:7:460:7 | x | test.cpp:458:6:458:6 | definition of x | test.cpp:458:6:458:6 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:458:6:458:6 | x | x |
2829
| test.cpp:467:2:467:2 | x | test.cpp:464:6:464:6 | definition of x | test.cpp:464:6:464:6 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:464:6:464:6 | x | x |
2930
| test.cpp:474:7:474:7 | x | test.cpp:471:6:471:6 | definition of x | test.cpp:471:6:471:6 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:471:6:471:6 | x | x |
31+
| test.cpp:594:6:594:8 | quo | test.cpp:592:6:592:8 | definition of quo | test.cpp:592:6:592:8 | definition of quo | The variable $@ may not be initialized at this access. | test.cpp:592:6:592:8 | quo | quo |

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,3 +581,15 @@ void test46()
581581
*rP = nullptr;
582582
use(r);
583583
}
584+
585+
namespace std {
586+
float remquo(float, float, int*);
587+
}
588+
589+
void test47() {
590+
float x = 1.0f;
591+
float y = 2.0f;
592+
int quo;
593+
std::remquo(x, y, &quo);
594+
use(quo); // GOOD [FALSE POSITIVE]
595+
}

0 commit comments

Comments
 (0)