On Sun, Oct 5, 2014 at 12:27 AM, Norihiro Tanaka <nori...@kcn.ne.jp> wrote: > Jim Meyering wrote: > Actually, we need yet another byte at the end, and one more prior: > >> When I built with ASAN and rawhide's gcc version 4.9.1 20140930 >> (Red Hat 4.9.1-11) (GCC), using this command: >> >> make CFLAGS=-ggdb3 AM_CFLAGS=-fsanitize=address \ >> AM_LDFLAGS='-fsanitize=address -static-libasan' check >> >> I saw two test failures. You can see that the first test triggers an access >> one past the end, and all others trigger an access one prior to the >> beginning. >> Here is a summary of the problems: > > Thanks, if begline option (-x) is set, one more prior is used. OTOH, > for an access one past the end, I believe the another patch attached > with this bug fixes it. dfaexec for non-UTF8 locales doesn't check the > end of an input buffer and doesn't count newline correctly.
Thank you. I have added a test case to your post-transit_state buffer-length checking patch, and shrank the eolbytes buffer by one byte, now that I see this patch prevents the overrun. Here's the patch I'll push later today:
0001-dfa-check-end-of-input-buffer-after-transition-in-no.patch
Description: Binary data