Re: libc/regex: safer pointer arithmetic

2021-01-03 Thread Miod Vallat
> regcomp.c uses the "start + count < end" idiom to check that there are > "count" bytes available in an array of char "start" and "end" both point > to. > > This is fine, unless "start + count" goes beyond the last element of the > array. In this case, pedantic interpretation of the C standard

Re: libc/regex: safer pointer arithmetic

2020-12-30 Thread Theo Buehler
On Tue, Dec 29, 2020 at 06:03:36AM -0700, Todd C. Miller wrote: > On Tue, 29 Dec 2020 10:33:26 +, Miod Vallat wrote: > > > regcomp.c uses the "start + count < end" idiom to check that there are > > "count" bytes available in an array of char "start" and "end" both point > > to. > > > > This

Re: libc/regex: safer pointer arithmetic

2020-12-29 Thread Todd C . Miller
On Tue, 29 Dec 2020 10:33:26 +, Miod Vallat wrote: > regcomp.c uses the "start + count < end" idiom to check that there are > "count" bytes available in an array of char "start" and "end" both point > to. > > This is fine, unless "start + count" goes beyond the last element of the > array. In

libc/regex: safer pointer arithmetic

2020-12-29 Thread Miod Vallat
regcomp.c uses the "start + count < end" idiom to check that there are "count" bytes available in an array of char "start" and "end" both point to. This is fine, unless "start + count" goes beyond the last element of the array. In this case, pedantic interpretation of the C standard makes the