Skip to content

Commit 96b46de

Browse files
committed
update alert-messages based on review feedback
1 parent edd0302 commit 96b46de

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

cpp/ql/src/Security/CWE/CWE-129/ImproperArrayIndexValidation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ where
127127
conf.hasFlowPath(source, sink) and
128128
isFlowSource(source.getNode(), sourceType)
129129
select sink.getNode(), source, sink,
130-
"An array indexing expression depends on a $@ that might be outside the bounds of the array.",
130+
"An array indexing expression depends on $@ that might be outside the bounds of the array.",
131131
source.getNode(), lowerFirst(sourceType)

cpp/ql/src/experimental/Security/CWE/CWE-020/NoCheckBeforeUnsafePutUser.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ class ExploitableUserModePtrParam extends SystemCallSource {
8787
}
8888

8989
from ExploitableUserModePtrParam p
90-
select p, "'unsafe_put_user' write user-mode pointer $@ without check.", p, p.toString()
90+
select p, "This 'unsafe_put_user' writes a user-mode pointer without a security check."

cpp/ql/src/experimental/Security/CWE/CWE-401/MemoryLeakOnFailedCallToRealloc.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ class ReallocCallLeak extends FunctionCall {
5858

5959
from ReallocCallLeak rcl
6060
where not rcl.mayHandleByTermination()
61-
select rcl, "Possible loss of original pointer on unsuccessful call realloc."
61+
select rcl, "Possible loss of original pointer on unsuccessful call to 'realloc'."

cpp/ql/src/experimental/Security/CWE/CWE-787/UnsignedToSignedPointerArith.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ where
2626
DataFlow::localFlow(DataFlow::parameterNode(p), sink) and
2727
p.getUnspecifiedType().getSize() < 8
2828
select call,
29-
"This call passes an unsigned int to a function that requires a signed int: $@. And then used in pointer arithmetic: $@.",
29+
"This call passes an unsigned int to a function that requires a signed int: $@. It's then used in pointer arithmetic: $@.",
3030
f, f.toString(), sink, sink.toString()
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| test.cpp:20:21:20:22 | ref arg & ... | 'unsafe_put_user' write user-mode pointer $@ without check. | test.cpp:20:21:20:22 | ref arg & ... | ref arg & ... |
2-
| test.cpp:41:21:41:22 | ref arg & ... | 'unsafe_put_user' write user-mode pointer $@ without check. | test.cpp:41:21:41:22 | ref arg & ... | ref arg & ... |
3-
| test.cpp:69:21:69:27 | ref arg & ... | 'unsafe_put_user' write user-mode pointer $@ without check. | test.cpp:69:21:69:27 | ref arg & ... | ref arg & ... |
1+
| test.cpp:20:21:20:22 | ref arg & ... | This 'unsafe_put_user' writes a user-mode pointer without a security check. |
2+
| test.cpp:41:21:41:22 | ref arg & ... | This 'unsafe_put_user' writes a user-mode pointer without a security check. |
3+
| test.cpp:69:21:69:27 | ref arg & ... | This 'unsafe_put_user' writes a user-mode pointer without a security check. |
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
| test.c:34:29:34:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
2-
| test.c:63:29:63:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
3-
| test.c:139:29:139:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
4-
| test.c:186:29:186:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
5-
| test.c:282:29:282:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
6-
| test.c:299:26:299:32 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
7-
| test.c:328:29:328:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
8-
| test.c:342:29:342:35 | call to realloc | Possible loss of original pointer on unsuccessful call realloc. |
1+
| test.c:34:29:34:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
2+
| test.c:63:29:63:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
3+
| test.c:139:29:139:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
4+
| test.c:186:29:186:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
5+
| test.c:282:29:282:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
6+
| test.c:299:26:299:32 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
7+
| test.c:328:29:328:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |
8+
| test.c:342:29:342:35 | call to realloc | Possible loss of original pointer on unsuccessful call to 'realloc'. |

cpp/ql/test/query-tests/Security/CWE/CWE-129/SAMATE/ImproperArrayIndexValidation/ImproperArrayIndexValidation.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nodes
55
| CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:52:20:52:23 | data | semmle.label | data |
66
subpaths
77
#select
8-
| CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:52:20:52:23 | data | CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:30:19:30:29 | fgets output argument | CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:52:20:52:23 | data | An array indexing expression depends on a $@ that might be outside the bounds of the array. | CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:30:19:30:29 | fgets output argument | string read by fgets |
8+
| CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:52:20:52:23 | data | CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:30:19:30:29 | fgets output argument | CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:52:20:52:23 | data | An array indexing expression depends on $@ that might be outside the bounds of the array. | CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_01.c:30:19:30:29 | fgets output argument | string read by fgets |

cpp/ql/test/query-tests/Security/CWE/CWE-129/semmle/ImproperArrayIndexValidation/ImproperArrayIndexValidation.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ nodes
2121
| test1.c:53:15:53:15 | j | semmle.label | j |
2222
subpaths
2323
#select
24-
| test1.c:18:16:18:16 | i | test1.c:8:16:8:19 | argv | test1.c:18:16:18:16 | i | An array indexing expression depends on a $@ that might be outside the bounds of the array. | test1.c:8:16:8:19 | argv | a command-line argument |
25-
| test1.c:33:11:33:11 | i | test1.c:8:16:8:19 | argv | test1.c:33:11:33:11 | i | An array indexing expression depends on a $@ that might be outside the bounds of the array. | test1.c:8:16:8:19 | argv | a command-line argument |
26-
| test1.c:53:15:53:15 | j | test1.c:8:16:8:19 | argv | test1.c:53:15:53:15 | j | An array indexing expression depends on a $@ that might be outside the bounds of the array. | test1.c:8:16:8:19 | argv | a command-line argument |
24+
| test1.c:18:16:18:16 | i | test1.c:8:16:8:19 | argv | test1.c:18:16:18:16 | i | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:8:16:8:19 | argv | a command-line argument |
25+
| test1.c:33:11:33:11 | i | test1.c:8:16:8:19 | argv | test1.c:33:11:33:11 | i | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:8:16:8:19 | argv | a command-line argument |
26+
| test1.c:53:15:53:15 | j | test1.c:8:16:8:19 | argv | test1.c:53:15:53:15 | j | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:8:16:8:19 | argv | a command-line argument |

0 commit comments

Comments
 (0)