Diff between 3fa0ee6c164abd3f440b1741807ec3c78ecd2890 and bb36652707dd1db2fbe178691c27f0fd079d2d51

Changed Files

File Additions Deletions Status
mgmt/main.c +6 -0 modified

Full Patch

diff --git a/mgmt/main.c b/mgmt/main.c
index cef79c0..a5ecb27 100644
--- a/mgmt/main.c
+++ b/mgmt/main.c
@@ -690,6 +690,12 @@ int main(int argc, char *argv[])
 		break;
 	}
 
+	if (command[i].cmd == NULL) {
+		fprintf(stderr, "Unknown command: %s\n", argv[0]);
+		close(mgmt_sk);
+		return -1;
+	}
+
 	pollfd.fd = mgmt_sk;
 	pollfd.events = POLLIN;
 	pollfd.revents = 0;