On Sat, Oct 28, 2017 at 10:31:50AM -0700, William Tu wrote: > Clang reports possible optarg as null pointer passed to atoi. > Fix it by adding ovs_assert check before. > > Signed-off-by: William Tu <[email protected]> > --- > utilities/ovs-appctl.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c > index 8f87cc4f6c6e..cc1326bc9478 100644 > --- a/utilities/ovs-appctl.c > +++ b/utilities/ovs-appctl.c > @@ -165,6 +165,7 @@ parse_command_line(int argc, char *argv[]) > exit(EXIT_SUCCESS); > > case 'T': > + ovs_assert(optarg); > time_alarm(atoi(optarg)); > break;
This is an example of "converting SIGSEGV to SIGABRT" as I mentioned earlier. I don't think it is valuable; both the computer and the human reader can understand that atoi(optarg) implies that optarg is nonnull. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
