Boost C++ Libraries: Ticket #5902: Division by zero when requesting null sized buffers https://svn.boost.org/trac10/ticket/5902 <p> The following code yields a division by zero in pool::malloc_need_resize() : </p> <pre class="wiki"> boost::pool&lt;&gt; p(0, 1, 1); p.malloc(); </pre><p> The code above requests at most one buffer of size zero. The expected behavior would be one of (i) malloc fails, (ii) malloc returns a null sized buffer. </p> <p> Regards </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5902 Trac 1.4.3 Étienne Dupuis <e.dupuis@…> Fri, 16 Sep 2011 10:53:17 GMT summary changed https://svn.boost.org/trac10/ticket/5902#comment:1 https://svn.boost.org/trac10/ticket/5902#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">Division by zero when requesting null sized buffes</span> → <span class="trac-field-new">Division by zero when requesting null sized buffers</span> </li> </ul> Ticket edupuis Thu, 03 May 2012 16:48:15 GMT owner, status changed https://svn.boost.org/trac10/ticket/5902#comment:2 https://svn.boost.org/trac10/ticket/5902#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Chris Newbold</span> to <span class="trac-author">edupuis</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket edupuis Thu, 03 May 2012 18:57:12 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5902#comment:3 https://svn.boost.org/trac10/ticket/5902#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Revision: 78310 Author: edupuis Date: mercredi 2 mai 2012 22:19:00 Message: Prevent division by zero when requesting null sized buffers. Fixes <a class="new ticket" href="https://svn.boost.org/trac10/ticket/5902" title="#5902: Bugs: Division by zero when requesting null sized buffers (new)">#5902</a>. </p> <hr /> <p> Modified : /sandbox/pool/boost/pool/pool.hpp Added : /sandbox/pool/libs/pool/test/test_bug_5902.cpp </p> Ticket edupuis Mon, 21 May 2012 05:59:45 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/5902#comment:4 https://svn.boost.org/trac10/ticket/5902#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket edupuis Mon, 16 Jul 2012 20:00:31 GMT owner, status changed https://svn.boost.org/trac10/ticket/5902#comment:5 https://svn.boost.org/trac10/ticket/5902#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">edupuis</span> to <span class="trac-author">John Maddock</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> <p> <a class="ext-link" href="https://svn.boost.org/svn/boost/sandbox/pool"><span class="icon">​</span>https://svn.boost.org/svn/boost/sandbox/pool</a> at revision 79460 contains a solution for tickets <a class="new ticket" href="https://svn.boost.org/trac10/ticket/3789" title="#3789: Bugs: boost::object_pool::free() is very slow. (new)">#3789</a>, <a class="new ticket" href="https://svn.boost.org/trac10/ticket/5902" title="#5902: Bugs: Division by zero when requesting null sized buffers (new)">#5902</a>, <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6561" title="#6561: Bugs: pool.free() crashes if given a null pointer (new)">#6561</a>, <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6610" title="#6610: Feature Requests: customizing boost::pool/boost::object_pool via template parameter for ... (new)">#6610</a>, <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6701" title="#6701: Bugs: integer overflows in ordered_malloc() (new)">#6701</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6718" title="#6718: Bugs: Missing images (closed: fixed)">#6718</a>, <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6865" title="#6865: Feature Requests: pool.get_size() (new)">#6865</a> and <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6867" title="#6867: Bugs: Unclear behavior of parameter 'max_size' (new)">#6867</a>. Related test cases are also present. </p> <p> <a class="ext-link" href="https://svn.boost.org/svn/boost/sandbox/pool"><span class="icon">​</span>https://svn.boost.org/svn/boost/sandbox/pool</a> at revision 79460 does <strong>not</strong> contain any other new features or modifications other than those related to the above tickets. </p> <p> Boost.Pool currently has no maintainer and is thus orphaned. </p> Ticket