Problem 2473 - Uninitialized memory in zlib
Summary: Uninitialized memory in zlib
Status: ASSIGNED
Alias: None
Product: Geant4
Classification: Unclassified
Component: global (show other problems)
Version: 10.7
Hardware: PC Linux
: P4 minor
Assignee: Gunter.Folger
URL: https://github.com/Geant4/geant4/pull/43
Depends on:
Blocks:
 
Reported: 2022-03-08 14:25 CET by Max Aehle
Modified: 2022-03-08 14:27 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Max Aehle 2022-03-08 14:25:01 CET
See a more extensive description in my GitHub pull request https://github.com/Geant4/geant4/pull/43 .

zlib 1.2.11 sometimes operates on heap-allocated memory before initializing it. The externally-visible behaviour seems not to depend on the undefined content of the uninitialized memory, due to the higher-level program logic. However, the memory checker Valgrind reports this as an error. This is problematic as it might draw attention from true positives.

The proposed fix initializes the memory with zeros before using it.