VOM: Inspect: fix the bug 55/9355/2
authorMohsin Kazmi <sykazmi@cisco.com>
Thu, 9 Nov 2017 12:30:59 +0000 (13:30 +0100)
committerNeale Ranns <nranns@cisco.com>
Thu, 9 Nov 2017 16:25:01 +0000 (16:25 +0000)
If key is passed without ":", results in segmentation fault.
This patch fixes this issue.

Change-Id: I4e6bb3431c261cc2ac752b966a11edd7aa3304a0
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
src/vpp-api/vom/inspect.cpp

index c78128c..55b533b 100644 (file)
@@ -54,10 +54,9 @@ inspect::handle_input(const std::string& message, std::ostream& output)
       }
     } else if (message.find("keys") != std::string::npos) {
       OM::dump(output);
-    } else if (message.find("key") != std::string::npos) {
+    } else if (message.find("key:") != std::string::npos) {
       std::vector<std::string> results;
       boost::split(results, message, boost::is_any_of(":\n"));
-
       OM::dump(results[1], output);
     } else if (message.find("all") != std::string::npos) {
       /*