[ovs-dev] [PATCH 05/11] ovs-ofctl: Fix possible null pointer.

Mark Michelson mmichels at redhat.com
Mon Oct 30 14:41:12 UTC 2017


Looks good to me.

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

> Clang reports possible null pointer of optarg as argument to strtoul.
> 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-ofctl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
> index 5b7f1b02104f..05c5995fa775 100644
> --- a/utilities/ovs-ofctl.c
> +++ b/utilities/ovs-ofctl.c
> @@ -262,6 +262,7 @@ parse_options(int argc, char *argv[])
>
>          switch (c) {
>          case 't':
> +            ovs_assert(optarg);
>              timeout = strtoul(optarg, NULL, 10);
>              if (timeout <= 0) {
>                  ovs_fatal(0, "value %s on -t or --timeout is not at least
> 1",
> --
> 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