On 1/4/21 4:52 AM, Adhemerval Zanella wrote:
The extra comparison might avoid the scratch_buffer resize that will fail (since malloc will fail to try allocate PTRDIFF_MAX object), but it will be used only when such objects are provided (which depending of the system should not happen).
As you say, that comparison isn't needed for glibc. It's also not needed on non-glibc because Gnulib prevents malloc etc. from succeeding on sizes greater than PTRDIFF_MAX. So we should be OK here.