[ovs-dev] [PATCH 11/11] ovs-testcontroller: Fix possible null pointer to atoi.

Mark Michelson mmichels at redhat.com
Mon Oct 30 15:25:58 UTC 2017


Looks good to me

On Sat, Oct 28, 2017 at 12:38 PM William Tu <u9012063 at gmail.com> wrote:

> Clang reports possible optarg as null passed to atoi.
> Fix it by adding ovs_assert check.
>
> Signed-off-by: William Tu <u9012063 at gmail.com>
>
Acked-by: Mark Michelson <mmichels at redhat.com>

> ---
>  utilities/ovs-testcontroller.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/utilities/ovs-testcontroller.c
> b/utilities/ovs-testcontroller.c
> index b4a451286455..be28d5494ec0 100644
> --- a/utilities/ovs-testcontroller.c
> +++ b/utilities/ovs-testcontroller.c
> @@ -318,6 +318,7 @@ parse_options(int argc, char *argv[])
>              if (!strcmp(optarg, "permanent")) {
>                  max_idle = OFP_FLOW_PERMANENT;
>              } else {
> +                ovs_assert(optarg);
>                  max_idle = atoi(optarg);
>                  if (max_idle < 1 || max_idle > 65535) {
>                      ovs_fatal(0, "--max-idle argument must be between 1
> and "
> @@ -327,6 +328,7 @@ parse_options(int argc, char *argv[])
>              break;
>
>          case 'q':
> +            ovs_assert(optarg);
>              default_queue = atoi(optarg);
>              break;
>
> --
> 2.7.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


More information about the dev mailing list