MarcoFalke fac932bf93
refactor: Use util::Split to avoid a harmless unsigned-integer-overflow
The previous commit added a test which would fail the
unsigned-integer-overflow sanitizer. The warning is harmless and can be
triggered on any commit, since the code was introduced.

For reference, the warning would happen when the separator `-` was not
present.

For example:

  GET /rest/getutxos/6a297bfa5cb8dd976ab0207a767d6cbfaa5e876f30081127ec8674c8c52b16c0_+1.json

would result in:

rest.cpp:792:77: runtime error: unsigned integer overflow: 18446744073709551615 + 1 cannot be represented in type 'size_type' (aka 'unsigned long')
    #0 0x55ad42c16931 in rest_getutxos(std::any const&, HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) src/rest.cpp:792:77
    #1 0x55ad4319e3c0 in std::function<bool (HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>::operator()(HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
    #2 0x55ad4319e3c0 in HTTPWorkItem::operator()() src/httpserver.cpp:59:9
    #3 0x55ad431a3eea in WorkQueue<HTTPClosure>::Run() src/httpserver.cpp:114:13
    #4 0x55ad4318f961 in HTTPWorkQueueRun(WorkQueue<HTTPClosure>*, int) src/httpserver.cpp:403:12
    #5 0x7f078ebcbbb3  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xeabb3) (BuildId: 40b9b0d17fdeebfb57331304da2b7f85e1396ef2)
    #6 0x55ad4277e01c in asan_thread_start(void*) asan_interceptors.cpp.o
    #7 0x7f078e840a93  (/lib/x86_64-linux-gnu/libc.so.6+0x9ca93) (BuildId: 08134323d00289185684a4cd177d202f39c2a5f3)
    #8 0x7f078e8cdc3b  (/lib/x86_64-linux-gnu/libc.so.6+0x129c3b) (BuildId: 08134323d00289185684a4cd177d202f39c2a5f3)

SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow rest.cpp:792:77
2024-07-17 12:22:28 +02:00
..
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2024-06-18 18:47:51 +02:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2023-10-12 11:27:19 +02:00
2024-04-10 17:01:27 +02:00
2024-06-13 11:20:49 +01:00
2024-07-08 11:12:01 +02:00
2024-03-04 19:53:30 -05:00
2024-07-08 11:12:01 +02:00
2023-12-11 18:22:13 +01:00
2024-07-08 11:12:01 +02:00
2023-11-16 11:36:22 +10:00
2023-09-13 11:37:45 +01:00
2024-05-20 16:48:19 +00:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2024-05-14 10:24:31 +02:00
2024-05-14 10:24:31 +02:00
2024-07-08 11:12:01 +02:00
2024-04-01 14:37:24 -04:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2023-11-16 11:36:22 +10:00