<div dir="ltr"><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 May 2017 at 05:40, Benjamin Bales <span dir="ltr"><<a href="mailto:benjamin.bales@qbitlogic.com" target="_blank">benjamin.bales@qbitlogic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Lex and Matthew, <div><br></div><div>You seem to disagree on this issue.  Is this a valid issue?  And if so, do you like the fix?  I can batch a few of them (<= 10) as a single PR.  No problem. </div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif">​Matthew is right, I misread the report as saying that `doc` was possibly NULL, not `file_name`.  At the moment the project members are having a crisis of availability, so at the moment smaller is better.  Checking a single one quickly is more likely to fit into someones day.</div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif">Cheers</div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif">Lex​</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>-Ben </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 10, 2017 at 8:22 PM, Matthew Brush <span dir="ltr"><<a href="mailto:mbrush@codebrainz.ca" target="_blank">mbrush@codebrainz.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 2017-05-10 04:09 PM, Lex Trotman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 11 May 2017 at 08:10, Benjamin Bales <<a href="mailto:benjamin.bales@qbitlogic.com" target="_blank">benjamin.bales@qbitlogic.com</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
CodeAi (<a href="https://github.com/C0deAi" rel="noreferrer" target="_blank">https://github.com/C0deAi</a>), an automated repair tool developed at<br>
QbitLogic (<a href="http://www.qbitlogic.com" rel="noreferrer" target="_blank">www.qbitlogic.com</a>), suggested the following fix. Could I<br>
submit it as a patch if it looks alright?<br>
<br>
plugins/saveactions.c: “doc->file_type” pointer might be dereferenced when<br>
null on line 283.  Initialization may be provided by “doc” passed in as a<br>
function argument, but a null check would be prudent just in case. The fix<br>
checks “doc->file_type” for null before allowing a dereference on the<br>
following line.  A snapshot of the bug report generated by CodeAi is<br>
attached.  A full report is available upon request.<br>
<br>
</blockquote>
<br>
This function is called (via the signal framework) by the function that<br>
created `doc` and as such cannot be null.  The design of the application<br>
uses the signal framework to decouple caller and callee and this is likely<br>
to confuse your tool since it cannot see where functions are called.<br>
Whilst any contributions are welcome, a report with a lot of similar false<br>
positives may end up being ignored and be a bad advertisement for your tool.<br>
<br>
</blockquote>
<br></span>
Naw, I think it's technically a real bug, albeit very minor. It's the `file_type` member of the `doc` that can be NULL. IIUC tools like this look to see if you checked the NULL-ness of something and then proceed to dereference it outside of that check later, which this code does (checks if `ft == NULL` several lines up and then unconditionally dereferences it on the line given by the OP).<br>
<br>
Regards,<br>
Matthew Brush<div class="m_8256610726846561649HOEnZb"><div class="m_8256610726846561649h5"><br>
<br>
______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" rel="noreferrer" target="_blank">https://lists.geany.org/cgi-bi<wbr>n/mailman/listinfo/devel</a><span class="HOEnZb"><font color="#888888"><br>
</font></span></div></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_8256610726846561649gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-size:12.8px">Benjamin Bales</div><div style="font-size:12.8px">Chief Technology Officer</div><div style="font-size:12.8px"><img src="https://media.licdn.com/mpr/mpr/shrink_200_200/AAEAAQAAAAAAAAlpAAAAJGRhNjRiNzc4LWJjNDctNGE2My05NWY1LTY2MDM3Y2YzZTM1OA.png" alt="QbitLogic" width="96" height="96"><br></div><div style="font-size:12.8px">1050 Crown Pointe Pkwy, Ste. 840</div><div style="font-size:12.8px">Atlanta, GA 30338 </div><div style="font-size:12.8px">470-554-2690</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:10pt;font-family:'Times New Roman',serif;color:navy">CONFIDENTIALITY NOTICE</span></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:10pt;font-family:'Times New Roman',serif;color:navy">This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to which they are addressed.  This communication may contain privileged attorney material or other Property and Confidential matter.  If you are not the intended recipient or the person responsible for delivering the e-mail for the intended person, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.  If you believe you have received this e-mail in error, please immediately delete this e-mail and notify Benjamin Bales by telephoning <a href="tel:470-554-2690" value="+14705542690" style="color:rgb(17,85,204)" target="_blank">470-554-2690</a>.</span></p></div></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" rel="noreferrer" target="_blank">https://lists.geany.org/cgi-<wbr>bin/mailman/listinfo/devel</a><br>
<br></blockquote></div><br></div></div>