Skip to content

Commit eb244c0

Browse files
committed
C++: Fix documentation.
1 parent 3662ec4 commit eb244c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void bad2(std::size_t length) noexcept {
2121
}
2222
}
2323

24-
// GOOD: the allocation failure is handled appropiately.
24+
// GOOD: the allocation failure is handled appropriately.
2525
void good1(std::size_t length) noexcept {
2626
try {
2727
int* dest = new int[length];
@@ -32,7 +32,7 @@ void good1(std::size_t length) noexcept {
3232
}
3333
}
3434

35-
// GOOD: the allocation failure is handled appropiately.
35+
// GOOD: the allocation failure is handled appropriately.
3636
void good2(std::size_t length) noexcept {
3737
int* dest = new int[length];
3838
if(!dest) {

cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Incorrect allocation-error handling
3-
* @description `operator new` throws an exception on allocation failures, while `operator new(std::nothrow)` returns a null pointer. Mixing up these two failure conditions can result in unexpected behavior.
3+
* @description Mixing up the failure conditions of 'operator new' and 'operator new(std::nothrow)' can result in unexpected behavior.
44
* @kind problem
55
* @id cpp/incorrect-allocation-error-handling
66
* @problem.severity warning

0 commit comments

Comments
 (0)