]> git.ipfire.org Git - thirdparty/bacula.git/commit
could: Fix 10788 cloud volume deletion crash
authorAlain Spineux <alain@baculasystems.com>
Fri, 15 Mar 2024 15:27:26 +0000 (16:27 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 21 Mar 2024 16:23:16 +0000 (17:23 +0100)
commit40f8a6acb37ff8e54d2b153fbac34737a125847b
treebc49a700efec4a01cac557e5ea61f2c7858ff920
parenta776ae5ba4e82eadb9175a3e48c113e57b84185b
could: Fix 10788 cloud volume deletion crash

- the problem is about iterating up to including parts.last_index()
  using parts.get(parts.last_index()) is a mistake !!!
  it works most of the time because most of the time this value is NULL
  and the code does a continue
  BUT when parts.last_index() == parts.max_size(), then
  parts.get(parts.last_index()) is out of the allocated memory and can
  contain garbage
- why is the code doing a "continue" ? Is it expected to have a NULL ?
  in the list ?
  in clean_cloud_volume_read_cb() that fill the list, there is no raison
  to have NULL ?
  With the bug, testing for NULL will save us 99% of the time
  Without the bug we can reach 100% :-)
bacula/src/stored/generic_driver.c