bug: chunk_size truncated from 64-bit to 32-bit on send and receive #30
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
chunk_sizefield inConfigisunsigned long long(64-bit), butconfig_send()serializes it viasend_int()which only sends anint(32-bit on most platforms):File:
src/shared/config.c:113And
config_receive()reads it back asintthen casts:File:
src/shared/config.c:188This means chunk sizes larger than 2 GB will be silently truncated, potentially causing data corruption or incorrect chunking behavior on very large transfers.
Fix: Use
send_n_data/receive_n_datawithsizeof(unsigned long long)instead ofsend_int/receive_intfor the chunk_size field.Severity: high