Initialize pad field in filecopy final response

Do not leak 4 bytes from the receiver stack.

Reported by @cfcs
This commit is contained in:
Marek Marczykowski-Górecki 2017-11-20 13:58:39 +01:00
parent 75fa0d3cb0
commit 141b9912e8
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -77,6 +77,7 @@ void send_status_and_crc(int code, const char *last_filename) {
saved_errno = errno; saved_errno = errno;
hdr.error_code = code; hdr.error_code = code;
hdr._pad = 0;
hdr.crc32 = crc32_sum; hdr.crc32 = crc32_sum;
if (!write_all(1, &hdr, sizeof(hdr))) if (!write_all(1, &hdr, sizeof(hdr)))
perror("write status"); perror("write status");