bareos: bareos-19.2 0086b852

Author Committer Branch Timestamp Parent
arogge arogge bareos-19.2 2020-09-30 16:20 bareos-19.2 2c217b4a Pending
Changeset stored: fix memory corruption in label.cc

pointer lifetime in WriteNewVolumeLabelToDev()
Previously, in WriteNewVolumeLabelToDev() a copy of the pointer
dcr->block was saved and then used as a parameter to EmptyBlock(). This
pointer's lifetime ends in dev->SetLabelBlockSize() when the previously
written device's block size was larger than the label block size.
This patch removes the copy and uses dcr->block directly, so the updated
pointer is used.

(cherry picked from commit 2cf9db2ded05ea3f5c0bfea587dfbc7e9064417f)
mod - core/src/stored/label.cc Diff File