Check the argument count before indexing config comment log args

A '# do:log.add_output=debug' line read args[1] past the end of the vector.
This commit is contained in:
xirvik
2026-09-19 01:06:31 +00:00
committed by Jari Sundell
parent d9439d7a95
commit 2086e8e780
4 changed files with 104 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "test/helpers/test_fixture.h"
class TestSetup : public test_fixture {
CPPUNIT_TEST_SUITE(TestSetup);
CPPUNIT_TEST(test_config_comment_log_add_output);
CPPUNIT_TEST(test_config_comment_log_add_output_no_args);
CPPUNIT_TEST(test_config_comment_log_add_output_one_arg);
CPPUNIT_TEST(test_config_comment_log_add_output_too_many_args);
CPPUNIT_TEST_SUITE_END();
public:
void test_config_comment_log_add_output();
void test_config_comment_log_add_output_no_args();
void test_config_comment_log_add_output_one_arg();
void test_config_comment_log_add_output_too_many_args();
};