Issue Details (XML | Word | Printable)

Key: CORE-6221
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Incorrect (throw-based) allocFunc for zlib1. Possible memory leak.

Created: 10/Jan/20 08:02 AM   Updated: 10/Jan/20 11:01 AM
Component/s: None
Affects Version/s: 4.0 Beta 1, 3.0.5
Fix Version/s: 4.0 Beta 2, 3.0.6

QA Status: Cannot be tested


 Description  « Hide
https://www.zlib.net/manual.html

Usage of z_stream_s structure: zalloc must return Z_NULL if there is not enough memory for the object.

Firebird code, if I understood correctly, assign to zalloc throw-based allocation func:

void* allocFunc(void*, uInt items, uInt size)
{
return MemoryPool::globalAlloc(items * size ALLOC_ARGS); //thow ?
}

In deflateInit, for example, has five calls of zalloc function and has rollback of initialization if second (and next) call of zalloc return nullptr.


 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
There are no comments yet on this issue.