[ovs-dev] [PATCH 04/11] lib/process: Fix possible null pointer argument.

Mark Michelson mmichels at redhat.com
Mon Oct 30 14:39:27 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 due to process_register could
> take the name from argv[0].  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 3e119b59bfbc..254052f2c27d 100644
> --- a/lib/process.c
> +++ b/lib/process.c
> @@ -172,6 +172,7 @@ process_register(const char *name, pid_t pid)
>      struct process *p;
>      const char *slash;
>
> +    ovs_assert(name);
>      p = xzalloc(sizeof *p);
>      p->pid = pid;
>      slash = strrchr(name, '/');
> --
> 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