Re: [PATCH] strlen: Fix another spot that can create invalid ranges [PR114293]

2024-03-12 Thread Richard Biener
On Tue, 12 Mar 2024, Jakub Jelinek wrote: > Hi! > > This PR is similar to PR110603 fixed with r14-8487, except in a different > spot. From the memset with -1 size of non-zero value we determine minimum > of (size_t) -1 and the code uses PTRDIFF_MAX - 2 (not really sure I > understand why it is

[PATCH] strlen: Fix another spot that can create invalid ranges [PR114293]

2024-03-12 Thread Jakub Jelinek
Hi! This PR is similar to PR110603 fixed with r14-8487, except in a different spot. From the memset with -1 size of non-zero value we determine minimum of (size_t) -1 and the code uses PTRDIFF_MAX - 2 (not really sure I understand why it is - 2 and not - 1, e.g. heap allocated array with