fix hardpoint hardfault by checking argc before std::strcmp

This commit is contained in:
ponomarevda
2021-10-27 08:11:23 +02:00
committed by Beat Küng
parent de488f0f40
commit 2b6bd452df
+1 -1
View File
@@ -1205,7 +1205,7 @@ int uavcan_main(int argc, char *argv[])
}
if (!std::strcmp(argv[1], "hardpoint")) {
if (!std::strcmp(argv[2], "set") && argc > 4) {
if (argc > 4 && !std::strcmp(argv[2], "set")) {
const int hardpoint_id = atoi(argv[3]);
const int command = atoi(argv[4]);