This is general question, because I'm confused of POSIX standards.
Assuming that SEGV is a BUG., which must be fixed.
I run program A with empty param:
It could be obvious that bug is in software A, but:
software A using library B to check if the environment is right (so NULL from A is passed into B).
Then library B passing NULL into library C (/lib/libc.so.7) and it crashing on strlen().
At the end:
Company policy of software A says that it isn't a bug in their software, because I didn't read the manual. And I'm using with wrong option and this software is not designed to use with non-existing options. Just use it in normal way, it will work.
Company policy of library B says that it isn't a bug in their library, because they just passing the argument as it is. And when using standard system function length(), software A or library C should care about the NULLs.
Company policy of library C says that it isn't a bug in their library, because this function is not designed to run with NULL parameter, please fix the BUG in your software.
Where is the BUG?
And where it should be fixed then?
Assuming that SEGV is a BUG., which must be fixed.
I run program A with empty param:
Code:
> ./a -
Segmentation fault (core dumped)
software A using library B to check if the environment is right (so NULL from A is passed into B).
Then library B passing NULL into library C (/lib/libc.so.7) and it crashing on strlen().
At the end:
Company policy of software A says that it isn't a bug in their software, because I didn't read the manual. And I'm using with wrong option and this software is not designed to use with non-existing options. Just use it in normal way, it will work.
Company policy of library B says that it isn't a bug in their library, because they just passing the argument as it is. And when using standard system function length(), software A or library C should care about the NULLs.
Company policy of library C says that it isn't a bug in their library, because this function is not designed to run with NULL parameter, please fix the BUG in your software.
Where is the BUG?
And where it should be fixed then?