[ovs-dev] [PATCH 10/11] lib: Fix possible null pointer to execvp.

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


This looks fine to me.
If you end up needing to re-work this patch series, I think it would be
appropriate to combine this with patch #4 since this is essentially fixing
the same possible NULL pointer.

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

> Clang reports possible null pointer 'argv[0]' to execvp.
> Fix it by adding ovs_assert check.
>
> Signed-off-by: William Tu <u9012063 at gmail.com>
>
Acked-by: Mark Michelson <mmichels at redhat.com>

> ---
>  lib/process.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/process.c b/lib/process.c
> index 254052f2c27d..0b8f994f9b75 100644
> --- a/lib/process.c
> +++ b/lib/process.c
> @@ -275,6 +275,7 @@ process_start(char **argv, struct process **pp)
>              close(fd);
>          }
>          xpthread_sigmask(SIG_SETMASK, &prev_mask, NULL);
> +        ovs_assert(argv[0]);
>          execvp(argv[0], argv);
>          fprintf(stderr, "execvp(\"%s\") failed: %s\n",
>                  argv[0], ovs_strerror(errno));
> --
> 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