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

William Tu u9012063 at gmail.com
Sat Oct 28 17:31:57 UTC 2017


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>
---
 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



More information about the dev mailing list