<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 11 May 2017 at 08:10, 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"><span id="m_3434792369454067257gmail-docs-internal-guid-e909c809-f467-fdfc-5946-679f1dd965b9"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">CodeAi (<a href="https://github.com/C0deAi" target="_blank">https://github.com/C0deAi</a>), an automated repair tool developed at QbitLogic (<a href="http://www.qbitlogic.com" target="_blank">www.qbitlogic.com</a>), suggested the following fix. Could I submit it as a patch if it looks alright? </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">plugins/saveactions.c: “doc->file_type” pointer might be dereferenced when null on line 283.  Initialization may be provided by “doc” passed in as a function argument, but a null check would be prudent just in case. The fix checks “doc->file_type” for null before allowing a dereference on the following line.  A snapshot of the bug report generated by CodeAi is attached.  A full report is available upon request.</span></p></span></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif">This function is called (via the signal framework) by the function that created `doc` and as such cannot be null.  The design of the application uses the signal framework to decouple caller and callee and this is likely to confuse your tool since it cannot see where functions are called.  Whilst any contributions are welcome, a report with a lot of similar false positives may end up being ignored and be a bad advertisement for your tool.</div></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><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><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"><span id="m_3434792369454067257gmail-docs-internal-guid-e909c809-f467-fdfc-5946-679f1dd965b9"><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> diff --git a/plugins/saveactions.c b/plugins/saveactions.c</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">@@ -280,8 +280,10 @@ static void instantsave_document_new_cb(<wbr>GObject *obj, GeanyDocument *doc, gpoint</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">    </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">doc->file_name = new_filename;</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> -</span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">    </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">if (doc->file_type->id == GEANY_FILETYPES_NONE)</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> +</span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">   </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">if(doc->file_type) {</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> +</span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">    if (doc->file_type->id == GEANY_FILETYPES_NONE)</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">   </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">document_set_filetype(doc, filetypes_lookup_by_name(<wbr>instantsave_default_ft));</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> +</span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">        </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">}</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">   </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">/* force saving the file to enable all the related actions(tab name, filetype, etc.) */</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">  </span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">        </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">document_save_file(doc, TRUE);</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">        </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">/* force saving the file to enable all the related actions(tab name, filetype, etc.) */</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">  </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="m_3434792369454067257gmail-Apple-tab-span" style="white-space:pre-wrap">       </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">document_save_file(doc, TRUE);</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">     }</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"> }</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">Base-commit: 84253714771f48dbc7fab02f7de43f<wbr>253734dee2</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap">Please let me know if you are interested in seeing more fixes from our tool. Thanks!</span></p><br><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><font color="#24292e" face="arial"><span style="font-size:16px;white-space:pre-wrap">Sincerely,</span></font></p></span><span class="HOEnZb"><font color="#888888">-- <br><div class="m_3434792369454067257gmail_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>