From 9e4843d53ed2064f8b17e6d0133e30ec5bc14392 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 23 Sep 2022 12:16:51 +0200 Subject: [PATCH] update the alert-message of cpp/file-may-not-be-closed based on feedback --- cpp/ql/src/Critical/FileMayNotBeClosed.ql | 2 +- .../FileClosed/FileMayNotBeClosed.expected | 6 ++-- .../tests-file/FileMayNotBeClosed.expected | 28 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cpp/ql/src/Critical/FileMayNotBeClosed.ql b/cpp/ql/src/Critical/FileMayNotBeClosed.ql index af38b437778..9a3aa6f8d4d 100644 --- a/cpp/ql/src/Critical/FileMayNotBeClosed.ql +++ b/cpp/ql/src/Critical/FileMayNotBeClosed.ql @@ -164,4 +164,4 @@ where fopenVariableReaches(v, def, ret) and ret.getAChild*() = v.getAnAccess() ) -select def, "The file opened here may not be closed at $@.", ret, "this exit point" +select def, "This file may not be closed at $@.", ret, "this exit point" diff --git a/cpp/ql/test/query-tests/Critical/FileClosed/FileMayNotBeClosed.expected b/cpp/ql/test/query-tests/Critical/FileClosed/FileMayNotBeClosed.expected index f9b30f68005..9f3de076e04 100644 --- a/cpp/ql/test/query-tests/Critical/FileClosed/FileMayNotBeClosed.expected +++ b/cpp/ql/test/query-tests/Critical/FileClosed/FileMayNotBeClosed.expected @@ -1,3 +1,3 @@ -| 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 | -| 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 | -| 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 | +| file.c:8:15:8:19 | call to fopen | This file may not be closed at $@. | file.c:12:13:12:19 | return ... | this exit point | +| file.c:18:15:18:19 | call to fopen | This file may not be closed at $@. | file.c:22:13:22:24 | return ... | this exit point | +| file.c:66:5:66:34 | ... = ... | This file may not be closed at $@. | file.c:74:5:74:13 | return ... | this exit point | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-772/semmle/tests-file/FileMayNotBeClosed.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-772/semmle/tests-file/FileMayNotBeClosed.expected index 5b08ccd6281..2221686631e 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-772/semmle/tests-file/FileMayNotBeClosed.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-772/semmle/tests-file/FileMayNotBeClosed.expected @@ -1,14 +1,14 @@ -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | +| test.cpp:59:2:59:30 | ... = ... | This file may not be closed at $@. | test.cpp:64:1:64:1 | return ... | this exit point | +| test.cpp:69:12:69:16 | call to fopen | This file may not be closed at $@. | test.cpp:73:3:73:9 | return ... | this exit point | +| test.cpp:85:2:85:30 | ... = ... | This file may not be closed at $@. | test.cpp:89:1:89:1 | return ... | this exit point | +| test.cpp:115:2:115:17 | ... = ... | This file may not be closed at $@. | test.cpp:121:3:121:9 | return ... | this exit point | +| test.cpp:115:2:115:17 | ... = ... | This file may not be closed at $@. | test.cpp:124:1:124:1 | return ... | this exit point | +| test.cpp:118:2:118:17 | ... = ... | This file may not be closed at $@. | test.cpp:121:3:121:9 | return ... | this exit point | +| test.cpp:221:12:221:16 | call to fopen | This file may not be closed at $@. | test.cpp:225:1:225:1 | return ... | this exit point | +| test.cpp:240:12:240:16 | call to fopen | This file may not be closed at $@. | test.cpp:249:1:249:1 | return ... | this exit point | +| test.cpp:253:12:253:16 | call to fopen | This file may not be closed at $@. | test.cpp:260:1:260:1 | return ... | this exit point | +| test.cpp:276:12:276:16 | call to fopen | This file may not be closed at $@. | test.cpp:281:3:281:9 | return ... | this exit point | +| test.cpp:299:12:299:16 | call to fopen | This file may not be closed at $@. | test.cpp:305:1:305:1 | return ... | this exit point | +| test.cpp:310:12:310:16 | call to fopen | This file may not be closed at $@. | test.cpp:323:1:323:1 | return ... | this exit point | +| test.cpp:356:12:356:16 | call to fopen | This file may not be closed at $@. | test.cpp:369:1:369:1 | return ... | this exit point | +| test.cpp:384:15:384:19 | call to fopen | This file may not be closed at $@. | test.cpp:394:1:394:1 | return ... | this exit point |