Re: bash-4.3 bug report

2014-04-14 Thread Dennis Williamson
On Apr 14, 2014 11:52 AM, "Dave Rutherford" wrote: > > On Mon, Apr 14, 2014 at 12:22 PM, David Binderman wrote: > > Anyone experienced looking at the code will always need to examine it > > more closely to find out why it's a good idea in this case to use an array > > index and *then* sanity chec

Re: bash-4.3 bug report

2014-04-14 Thread Dave Rutherford
On Mon, Apr 14, 2014 at 12:22 PM, David Binderman wrote: > Anyone experienced looking at the code will always need to examine it > more closely to find out why it's a good idea in this case to use an array > index and *then* sanity check it's value. But in this case it's a limiting check, not a b

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
On 04/14/2014 10:22 AM, David Binderman wrote: > Hello there, > > >> But my point remains to the original poster: a patch >> without justification is unlikely to be applied. Document WHY you think >> the existing code is a bug, not just HOW to fix it, for y

RE: bash-4.3 bug report

2014-04-14 Thread David Binderman
Hello there, > But my point remains to the original poster: a patch > without justification is unlikely to be applied. Document WHY you think > the existing code is a bug, not just HOW to fix it, for your patch to be > usefully considered. Standard softwar

Re: bash-4.3 bug report

2014-04-14 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 4/14/14, 11:19 AM, Eric Blake wrote: > On 04/14/2014 08:50 AM, Chet Ramey wrote: >> On 4/14/14, 5:34 AM, David Binderman wrote: >>> Hello there, >>> >>> [bind.c:2238]: (style) Array index 'j' is used before limits check. >>> >>> Source code is >>>

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
On 04/14/2014 09:35 AM, Andreas Schwab wrote: > Eric Blake writes: > >> In that case, the index check is dead code, > > No. You don't understand. Fair enough. But my point remains to the original poster: a patch without justification is unlikely to be applied. Document WHY you think the exist

Re: bash-4.3 bug report

2014-04-14 Thread Andreas Schwab
Eric Blake writes: > In that case, the index check is dead code, No. You don't understand. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
On 04/14/2014 09:26 AM, Andreas Schwab wrote: > Eric Blake writes: > >> It silences static code checkers and avoids undefined C behavior. >> >> Also, if invokers[] is allocated such that it ends on the end of a page >> boundary (such as might be the case under certain malloc debuggers), >> then d

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
On 04/14/2014 08:50 AM, Chet Ramey wrote: > On 4/14/14, 5:34 AM, David Binderman wrote: >> Hello there, >> >> [bind.c:2238]: (style) Array index 'j' is used before limits check. >> >> Source code is >> >> for (j = 0; invokers[j] && j < 5; j++) >> >> Suggest new code >> >> for (

Re: bash-4.3 bug report

2014-04-14 Thread Andreas Schwab
Eric Blake writes: > It silences static code checkers and avoids undefined C behavior. > > Also, if invokers[] is allocated such that it ends on the end of a page > boundary (such as might be the case under certain malloc debuggers), > then doing the bounds check first will avoid an out-of-bounds

Re: bash-4.3 bug report

2014-04-14 Thread Chet Ramey
On 4/14/14, 5:34 AM, David Binderman wrote: > Hello there, > > [bind.c:2238]: (style) Array index 'j' is used before limits check. > > Source code is > > for (j = 0; invokers[j] && j < 5; j++) > > Suggest new code > > for (j = 0; (j < 5) && (invokers[j] != NULL); j++) Can