kern/78256: strstr could be more robust

Bruce Evans bde at zeta.org.au
Wed Mar 9 21:18:35 GMT 2005


On Wed, 9 Mar 2005, Dan Allen wrote:

> On Mar 9, 2005, at 7:18 AM, Gleb Smirnoff wrote:
>> Not a bug, sorry. See also bin/52691.

> Why are you so reluctant to add one test to improve robustness?  Since it is 
> not specified one way or the other in the standard, it will not break 
> compatibility with the standard.  So it is not a bug technically - you still 
> could with a single line of C code improve the robustness of the system.  Not 
> doing so seems shortsighted.

Adding the test would unimprove robustness (except on systems that don't
trap on null pointers -- then a test, followed by a call to abort() or
signal(), would be needed to give the same behaviour as a null pointer
trap).  Aborting a program immediately when undefined behaviour in it
is detected improves robustness by limiting the undefined behaviour to
just halting the program and possibly generating a core dump, and by
making the bug obvious and easy to debug so that it gets fixed.

Bruce


More information about the freebsd-bugs mailing list