summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-04-05 11:40:03 -0500
committerJoel Sherrill <joel@rtems.org>2021-04-07 15:33:26 -0500
commite84b9f3a94c35c80785cf7a855a50f34bfe601e0 (patch)
tree2913b4311dfa410f7d049886c62d401b0dae4bc1
parentcovoar: Use range-based for loops in ReportsBase (diff)
downloadrtems-tools-e84b9f3a94c35c80785cf7a855a50f34bfe601e0.tar.bz2
covoar: Fix NULL check of wrong variable (CID #1399602)
CID 1399602: Dereference null return value in Explanations::writeNotFound(). In Explanations::writeNotFound() there were two NULL checks of the `fileName` variable where only one is needed. The second check has been changed to a NULL check of `notFoundFile` to match the original intent. Closes #4377
-rw-r--r--tester/covoar/Explanations.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tester/covoar/Explanations.cc b/tester/covoar/Explanations.cc
index 7b0f95a..12bd809 100644
--- a/tester/covoar/Explanations.cc
+++ b/tester/covoar/Explanations.cc
@@ -140,10 +140,10 @@ done:
return;
notFoundFile = fopen( fileName, "w" );
- if (!fileName) {
+ if (notFoundFile == nullptr) {
std::ostringstream what;
what << "Unable to open " << fileName
- << "out of sync at the explanation";
+ << " out of sync at the explanation";
throw rld::error( what, "Explanations::writeNotFound" );
}