Skip to content

Commit 2351884

Browse files
committed
update some alert-messages based on review feedback
1 parent a3c051b commit 2351884

File tree

8 files changed

+27
-27
lines changed

8 files changed

+27
-27
lines changed

cpp/ql/src/Critical/FileMayNotBeClosed.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ where
164164
fopenVariableReaches(v, def, ret) and
165165
ret.getAChild*() = v.getAnAccess()
166166
)
167-
select def, "This file open may not be closed at $@.", ret, "this exit point"
167+
select def, "The file opened here may not be closed at $@.", ret, "this exit point"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,5 @@ where
123123
conf.hasFlowPath(source, sink) and
124124
isFlowSource(source.getNode(), sourceType)
125125
select sink.getNode(), source, sink,
126-
"An array indexing expression depends on $@, potentially causing an invalid access.",
126+
"An array indexing expression depends on a $@ that might be outside the bounds of the array.",
127127
source.getNode(), sourceType

cpp/ql/src/Security/CWE/CWE-170/ImproperNullTerminationTainted.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ class TaintSource extends VariableAccess {
8686

8787
from TaintSource source, VariableAccess sink
8888
where source.reaches(sink)
89-
select sink, "$@ that may not be null terminated flows to a string operation.", source,
90-
"User-provided value"
89+
select sink, "String operation depends on a $@ that may not be null terminated.", source,
90+
"user-provided value"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| file.c:8:15:8:19 | call to fopen | This file open may not be closed at $@. | file.c:12:13:12:19 | return ... | this exit point |
2-
| file.c:18:15:18:19 | call to fopen | This file open may not be closed at $@. | file.c:22:13:22:24 | return ... | this exit point |
3-
| file.c:66:5:66:34 | ... = ... | This file open may not be closed at $@. | file.c:74:5:74:13 | return ... | this exit point |
1+
| file.c:8:15:8:19 | call to fopen | The file opened here may not be closed at $@. | file.c:12:13:12:19 | return ... | this exit point |
2+
| file.c:18:15:18:19 | call to fopen | The file opened here may not be closed at $@. | file.c:22:13:22:24 | return ... | this exit point |
3+
| file.c:66:5:66:34 | ... = ... | The file opened here may not be closed at $@. | file.c:74:5:74:13 | return ... | this exit point |
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.cpp:466:10:466:15 | buffer | $@ that may not be null terminated flows to a string operation. | test.cpp:465:18:465:23 | buffer | User-provided value |
2-
| test.cpp:481:10:481:15 | buffer | $@ that may not be null terminated flows to a string operation. | test.cpp:480:9:480:14 | buffer | User-provided value |
1+
| test.cpp:466:10:466:15 | buffer | String operation depends on a $@ that may not be null terminated. | test.cpp:465:18:465:23 | buffer | user-provided value |
2+
| test.cpp:481:10:481:15 | buffer | String operation depends on a $@ that may not be null terminated. | test.cpp:480:9:480:14 | buffer | user-provided value |

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 $@, potentially causing an invalid access. | 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 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 |

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 $@, potentially causing an invalid access. | 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 $@, potentially causing an invalid access. | 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 $@, potentially causing an invalid access. | 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 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 |
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
| test.cpp:59:2:59:30 | ... = ... | This file open may not be closed at $@. | test.cpp:64:1:64:1 | return ... | this exit point |
2-
| test.cpp:69:12:69:16 | call to fopen | This file open may not be closed at $@. | test.cpp:73:3:73:9 | return ... | this exit point |
3-
| test.cpp:85:2:85:30 | ... = ... | This file open may not be closed at $@. | test.cpp:89:1:89:1 | return ... | this exit point |
4-
| test.cpp:115:2:115:17 | ... = ... | This file open may not be closed at $@. | test.cpp:121:3:121:9 | return ... | this exit point |
5-
| test.cpp:115:2:115:17 | ... = ... | This file open may not be closed at $@. | test.cpp:124:1:124:1 | return ... | this exit point |
6-
| test.cpp:118:2:118:17 | ... = ... | This file open may not be closed at $@. | test.cpp:121:3:121:9 | return ... | this exit point |
7-
| test.cpp:221:12:221:16 | call to fopen | This file open may not be closed at $@. | test.cpp:225:1:225:1 | return ... | this exit point |
8-
| test.cpp:240:12:240:16 | call to fopen | This file open may not be closed at $@. | test.cpp:249:1:249:1 | return ... | this exit point |
9-
| test.cpp:253:12:253:16 | call to fopen | This file open may not be closed at $@. | test.cpp:260:1:260:1 | return ... | this exit point |
10-
| test.cpp:276:12:276:16 | call to fopen | This file open may not be closed at $@. | test.cpp:281:3:281:9 | return ... | this exit point |
11-
| test.cpp:299:12:299:16 | call to fopen | This file open may not be closed at $@. | test.cpp:305:1:305:1 | return ... | this exit point |
12-
| test.cpp:310:12:310:16 | call to fopen | This file open may not be closed at $@. | test.cpp:323:1:323:1 | return ... | this exit point |
13-
| test.cpp:356:12:356:16 | call to fopen | This file open may not be closed at $@. | test.cpp:369:1:369:1 | return ... | this exit point |
14-
| test.cpp:384:15:384:19 | call to fopen | This file open may not be closed at $@. | test.cpp:394:1:394:1 | return ... | this exit point |
1+
| test.cpp:59:2:59:30 | ... = ... | The file opened here may not be closed at $@. | test.cpp:64:1:64:1 | return ... | this exit point |
2+
| test.cpp:69:12:69:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:73:3:73:9 | return ... | this exit point |
3+
| test.cpp:85:2:85:30 | ... = ... | The file opened here may not be closed at $@. | test.cpp:89:1:89:1 | return ... | this exit point |
4+
| test.cpp:115:2:115:17 | ... = ... | The file opened here may not be closed at $@. | test.cpp:121:3:121:9 | return ... | this exit point |
5+
| test.cpp:115:2:115:17 | ... = ... | The file opened here may not be closed at $@. | test.cpp:124:1:124:1 | return ... | this exit point |
6+
| test.cpp:118:2:118:17 | ... = ... | The file opened here may not be closed at $@. | test.cpp:121:3:121:9 | return ... | this exit point |
7+
| test.cpp:221:12:221:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:225:1:225:1 | return ... | this exit point |
8+
| test.cpp:240:12:240:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:249:1:249:1 | return ... | this exit point |
9+
| test.cpp:253:12:253:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:260:1:260:1 | return ... | this exit point |
10+
| test.cpp:276:12:276:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:281:3:281:9 | return ... | this exit point |
11+
| test.cpp:299:12:299:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:305:1:305:1 | return ... | this exit point |
12+
| test.cpp:310:12:310:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:323:1:323:1 | return ... | this exit point |
13+
| test.cpp:356:12:356:16 | call to fopen | The file opened here may not be closed at $@. | test.cpp:369:1:369:1 | return ... | this exit point |
14+
| test.cpp:384:15:384:19 | call to fopen | The file opened here may not be closed at $@. | test.cpp:394:1:394:1 | return ... | this exit point |

0 commit comments

Comments
 (0)