Re: [libvirt PATCH 3/4] virFileReadLimFD: Limit maximum file size to INT_MAX - 1

2021-07-21 Thread Daniel P . Berrangé
On Wed, Jul 21, 2021 at 03:02:59PM +0200, Peter Krempa wrote: > On Wed, Jul 21, 2021 at 14:46:42 +0200, Tim Wiederhake wrote: > > virFileReadLimFD always returns null-terminated data. To that end, it has to > > add one to the maximum file size. If the maxium file size is INT_MAX, this > > triggers

Re: [libvirt PATCH 3/4] virFileReadLimFD: Limit maximum file size to INT_MAX - 1

2021-07-21 Thread Peter Krempa
On Wed, Jul 21, 2021 at 14:46:42 +0200, Tim Wiederhake wrote: > virFileReadLimFD always returns null-terminated data. To that end, it has to > add one to the maximum file size. If the maxium file size is INT_MAX, this > triggers a signed integer overflow. > > There is no instance left where a call

[libvirt PATCH 3/4] virFileReadLimFD: Limit maximum file size to INT_MAX - 1

2021-07-21 Thread Tim Wiederhake
virFileReadLimFD always returns null-terminated data. To that end, it has to add one to the maximum file size. If the maxium file size is INT_MAX, this triggers a signed integer overflow. There is no instance left where a caller would call virFileReadLimFD with a maxium file size of INT_MAX. Make