Opened 11 years ago

Last modified 10 years ago

#5902 new Bugs

Division by zero when requesting null sized buffers

Reported by: Étienne Dupuis <e.dupuis@…> Owned by: John Maddock
Milestone: To Be Determined Component: pool
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

The following code yields a division by zero in pool::malloc_need_resize() :

	boost::pool<> p(0, 1, 1);
	p.malloc();

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.

Regards

Change History (5)

comment:1 by Étienne Dupuis <e.dupuis@…>, 11 years ago

Summary: Division by zero when requesting null sized buffesDivision by zero when requesting null sized buffers

comment:2 by edupuis, 10 years ago

Owner: changed from Chris Newbold to edupuis
Status: newassigned

comment:3 by edupuis, 10 years ago

Resolution: fixed
Status: assignedclosed

Revision: 78310 Author: edupuis Date: mercredi 2 mai 2012 22:19:00 Message: Prevent division by zero when requesting null sized buffers. Fixes #5902.


Modified : /sandbox/pool/boost/pool/pool.hpp Added : /sandbox/pool/libs/pool/test/test_bug_5902.cpp

comment:4 by edupuis, 10 years ago

Resolution: fixed
Status: closedreopened

comment:5 by edupuis, 10 years ago

Owner: changed from edupuis to John Maddock
Status: reopenednew

https://svn.boost.org/svn/boost/sandbox/pool at revision 79460 contains a solution for tickets #3789, #5902, #6561, #6610, #6701, #6718, #6865 and #6867. Related test cases are also present.

https://svn.boost.org/svn/boost/sandbox/pool at revision 79460 does not contain any other new features or modifications other than those related to the above tickets.

Boost.Pool currently has no maintainer and is thus orphaned.

Note: See TracTickets for help on using tickets.