~vcs-imports/dpkg/master

Viewing all changes in revision 9589.

  • Committer: Guillem Jover
  • Date: 2020-12-24 03:24:40 UTC
  • Revision ID: git-v1:a72705e8835e8e63cac61f0148e85a8fd3c51942
libdpkg: Fix allocation size wrap around when growing a varbuf

When we allocate the buffer when growing a varbuf, we need to make sure
the new size is not wrapping around, or we might end up allowing to
write into unallocated memory or memory allocated for another buffer.

If we have a buffer that takes half the possibly allocatable memory,
and need less than half of that, we do not make it possible to allocate
just that instead of its double, as that would certainly leave the rest
of the program or the entire system without much resources anyway.

Stable-Candidate: 1.19.x

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: