Daniel P. Berrangé ae6a89884a tests: fix two off-by-1 errors in read-big-pipe test
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 with '\0'. The return value of virStrcpy wasn't
checked, but was reporting this truncation.

When testPipeFeeder then sends the padded buffer down the pipe, it 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 a very NUL terminated
string ('\0\0\0'). This is all harmless, but should be fixed regardless.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-05-08 14:33:42 +01:00
..
2023-04-06 12:48:22 +02:00
2023-12-14 17:10:22 +01:00
2024-03-12 17:37:51 +01:00
2024-03-12 17:37:51 +01:00
2024-03-21 14:42:27 +01:00
2024-03-14 15:17:48 +01:00
2024-03-21 14:42:20 +01:00
2023-12-14 17:10:22 +01:00
2023-04-06 12:48:22 +02:00
2024-03-14 15:17:48 +01:00
2024-03-14 15:17:48 +01:00
2023-04-04 10:52:15 +02:00
2024-03-14 15:17:48 +01:00
2023-03-13 13:29:07 +01:00
2024-03-14 15:17:48 +01:00
2024-03-14 15:17:48 +01:00
2024-03-14 15:17:48 +01:00