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

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


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



More information about the dev mailing list