glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

Fix: Correct initialization of size_t variable to avoid overflow

Open insistxc opened this issue 1 month ago • 1 comments

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 avatar Oct 31 '25 08:10 insistxc

@insistxc The variable is used always after assigning valid value though. Could you tell me the code path where you found it is overflowing?

pranithk avatar Dec 08 '25 05:12 pranithk