Re: [PATCH 2/3] tests: Don't pass INT_MAX to virFileReadAll()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/14/21 1:31 PM, Tim Wiederhake wrote:
> On Mon, 2021-06-14 at 13:06 +0200, Michal Privoznik wrote:
>> In a few occasions in tests we pass INT_MAX to
>> virFileReadLimFD(). This is not safe because virFileReadAll()
>> will call virFileReadLimFD() under the hood which takes the limit
>> and adds 1 to it.
> 
> Calling virFileReadAll with "INT_MAX - 1" looks funny. Is it possible
> to check for "maxlen >= INT_MAX" in virFileReadLimFD instead?

Actually, I don't understand why we need to add 1 in the first place.
I'll push the other two patches and send v2 for this that removes the +1.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux