From 5d026466ff0b6760d90c4f2286331861fe6fb171 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 6 Sep 2022 19:58:20 -0400 Subject: [PATCH] Correctly clean up VectorBool optional arguments in chip-tool. (#22414) We were not actually resetting the Optional (and in fact were operating on totally the wrong type, and it's not clear why this was not crashing all the time). Fixes https://github.com/project-chip/connectedhomeip/issues/22406 --- examples/chip-tool/commands/common/Command.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 0f738bc4da8ae8..6717bcbbc03216 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -898,8 +898,7 @@ void Command::ResetArguments() break; } case ArgumentType::VectorBool: { - auto vectorArgument = static_cast *>(arg.value); - vectorArgument->clear(); + ResetOptionalArg>(arg); break; } case ArgumentType::Vector16: {