[ovs-dev] [PATCH 03/11] ovs-appctl: Fix possible null pointer argument.

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


Clang reports possible optarg as null pointer passed to atoi.
Fix it by adding ovs_assert check before.

Signed-off-by: William Tu <u9012063 at gmail.com>
---
 utilities/ovs-appctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c
index 8f87cc4f6c6e..cc1326bc9478 100644
--- a/utilities/ovs-appctl.c
+++ b/utilities/ovs-appctl.c
@@ -165,6 +165,7 @@ parse_command_line(int argc, char *argv[])
             exit(EXIT_SUCCESS);
 
         case 'T':
+            ovs_assert(optarg);
             time_alarm(atoi(optarg));
             break;
 
-- 
2.7.4



More information about the dev mailing list