bug#22181: endless loop in grep 2.22

2015-12-18 Thread Jim Meyering
On Tue, Dec 15, 2015 at 12:20 PM, Christian Boltz wrote: > Hello, > > I hit an endless loop in grep 2.22. I can reproduce it with > > # grep -obUa -P '\x04\x08\x00profile\x00\x07' cache--usr.sbin.smbldap-useradd > 16profile > 27801profile > 27801profile > 27801profile > 27801profile > 27801profile

bug#22181: endless loop in grep 2.22

2015-12-18 Thread Paul Eggert
On 12/18/2015 12:52 PM, Jim Meyering wrote: And here is the patch that will form the basis of a complete fix: Thanks for looking into that; you beat me to it! POSIX says grep has undefined behavior when given an encoding error, and looping forever sure fills the bill :-).

bug#22181: endless loop in grep 2.22

2015-12-18 Thread Jim Meyering
On Fri, Dec 18, 2015 at 1:50 PM, Paul Eggert wrote: > On 12/18/2015 12:52 PM, Jim Meyering wrote: >> >> And here is the patch that will form the basis of a complete fix: > > Thanks for looking into that; you beat me to it! > > POSIX says grep has undefined behavior when given an encoding error, an