Re: [PATCH 2/2] tests: fix two off-by-1 errors in read-big-pipe test

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

 



On Wed, May 08, 2024 at 01:11:31PM GMT, Daniel P. Berrangé wrote:
> When testPipeFeeder copies the XML document into the padded buffer, it
> tells virStrcpy that 'xmlsize' bytes are available. This is under
> reporting size by 1 byte, and as a result it fails to copy the trailing
> '\n' replacing it when '\0'. The return value of virStrcpy wasn't

*replacing it with

> checked, but was reporting this truncation.
>
> When testPipeFeeder then sends the padded buffer down the pipe, it askes

*asks

> to send 'emptyspace + xmlsize + 1' bytes, which means it sends the data,
> as well as the trailing '\0' terminator.
>
> Both bugs combined mean it is sending '\0\0' as the last bytes, instead
> of '\n' which was intended. When virFileReadAll reads data from the
> pipe, it ends up adding another '\0' resulting in in a very NUL

*resulting in a very

Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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