<div dir="ltr"><span id="gmail-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">https://github.com/C0deAi</a>), an automated repair tool developed at QbitLogic (<a href="http://www.qbitlogic.com">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><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(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="gmail-Apple-tab-span" style="white-space:pre">     </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">      </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">     </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">   </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">     </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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(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="gmail-Apple-tab-span" style="white-space:pre">     </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">     </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">  </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">  </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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="gmail-Apple-tab-span" style="white-space:pre">    </span></span><span style="font-size:12pt;font-family:arial;color:rgb(36,41,46);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </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: 84253714771f48dbc7fab02f7de43f253734dee2</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>-- <br><div class="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>
</div>