Reject out-of-range RPC values instead of narrowing them silently.

Guards choke group max, set-port and info-hash length; parsing now uses std::from_chars.
This commit is contained in:
xirvik
2026-09-19 01:03:55 +00:00
parent 05cdd03cd2
commit f79cb257d7
15 changed files with 424 additions and 17 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "test/helpers/test_fixture.h"
class TestParse : public test_fixture {
CPPUNIT_TEST_SUITE(TestParse);
CPPUNIT_TEST(test_whole_value_in_range);
CPPUNIT_TEST(test_whole_value_out_of_range);
CPPUNIT_TEST(test_whole_value_bases);
CPPUNIT_TEST(test_whole_value_prefixes);
CPPUNIT_TEST_SUITE_END();
public:
void test_whole_value_in_range();
void test_whole_value_out_of_range();
void test_whole_value_bases();
void test_whole_value_prefixes();
};