<div dir="ltr">Repeating what I added to the ticket:<br><br>CID #1399602 is about a NULL reference in the same method which traces<br> back to the incorrect variable being checked. Coverity didn't realize it<br> was the wrong variable but did find something wrong that could lead to a<br> NULL pointer dereference.<br><br> Check me and please cite it in the ticket and git commit message.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 7, 2021 at 10:37 AM Alex White <<a href="mailto:alex.white@oarcorp.com">alex.white@oarcorp.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In Explanations::writeNotFound() there were two NULL checks of the<br>
`fileName` variable where only one is needed. The second check has been<br>
changed to a NULL check of `notFoundFile` to match the original intent.<br>
<br>
Closes #4377<br>
---<br>
tester/covoar/Explanations.cc | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/tester/covoar/Explanations.cc b/tester/covoar/Explanations.cc<br>
index 7b0f95a..12bd809 100644<br>
--- a/tester/covoar/Explanations.cc<br>
+++ b/tester/covoar/Explanations.cc<br>
@@ -140,10 +140,10 @@ done:<br>
return;<br>
<br>
notFoundFile = fopen( fileName, "w" );<br>
- if (!fileName) {<br>
+ if (notFoundFile == nullptr) {<br>
std::ostringstream what;<br>
what << "Unable to open " << fileName<br>
- << "out of sync at the explanation";<br>
+ << " out of sync at the explanation";<br>
throw rld::error( what, "Explanations::writeNotFound" );<br>
}<br>
<br>
-- <br>
2.27.0<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>