<div class="markdown_content"><hr/>
<p><strong> <a class="alink" href="https://sourceforge.net/p/pure-data/patches/578/">[patches:#578]</a> fix for crash in canvas_initbang() when loading malformed patch files</strong></p>
<p><strong>Status:</strong> open<br/>
<strong>Group:</strong> bugfix<br/>
<strong>Labels:</strong> crash <br/>
<strong>Created:</strong> Sat Jun 25, 2016 08:33 PM UTC by Claude Heiland-Allen<br/>
<strong>Last Updated:</strong> Sat Jun 25, 2016 08:33 PM UTC<br/>
<strong>Owner:</strong> Miller Puckette<br/>
<strong>Attachments:</strong></p>
<ul>
<li><a class="" href="https://sourceforge.net/p/pure-data/patches/578/attachment/0001-fix-canvas_initbang-crash-when-loading-bad-patch-fil.patch">0001-fix-canvas_initbang-crash-when-loading-bad-patch-fil.patch</a> (1.6 kB; text/x-patch)</li>
</ul>
<p>Pd crashes in canvas_initbang() if you load a file that isn't really a patch, because binbuf_evalfile() assumes the file is a regular patch that created a canvas during evaluation.  The fix is to check that the #X symbol is really bound to a canvas before calling canvas_initbang() on its thing.</p>
<p>For an example of the crash:</p>
<div class="codehilite"><pre>echo oops > oops.pd
pd oops.pd
</pre></div>


<p>With the attached patch Pd no longer crashes and instead prints "oops: no such object".</p>
<hr/>
<p>Sent from sourceforge.net because pd-dev@lists.iem.at is subscribed to <a href="https://sourceforge.net/p/pure-data/patches/">https://sourceforge.net/p/pure-data/patches/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/pure-data/admin/patches/options.">https://sourceforge.net/p/pure-data/admin/patches/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>