glusterfs
glusterfs copied to clipboard
Fix: Correct initialization of size_t variable to avoid overflow
In the functions glfs_anonymous_pwritev and iobuf_copy, the size_t variable size was incorrectly initialized to -1, causing an overflow when assigned to a size_t (an unsigned type).
This commit updates the initialization to 0, ensuring proper handling of size values and preventing potential bugs related to the overflow.
@insistxc The variable is used always after assigning valid value though. Could you tell me the code path where you found it is overflowing?