HTTP Request with bad HTTP version in header crashes server
The HTTP server crashes if it receives a header with HTTP version as string or large number.
OS: Ubuntu 20.04
Project version: 260755ec
Error: terminate called after throwing an instance of 'std::invalid_argument' what(): stof
Steps to reproduce:
Clone the project from the above commit
Follow README.md to build and run
Use telnet or similar to send a request, f.ex.:
telnet localhost 8080
GET / HTTP/notanumber #press enter twice
Stacktrace:
terminate called after throwing an instance of 'std::invalid_argument'
what(): stof
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff7bbd859 in __GI_abort () at abort.c:79
#2 0x00007ffff7e43951 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff7e4f47c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff7e4f4e7 in std::terminate() ()
from /lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff7e4f799 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff7e4630e in std::__throw_invalid_argument(char const*) ()
from /lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00005555556a0cbe in __gnu_cxx::__stoa<float, float, char> (
__convf=0x7ffff7be46b0 <__GI_strtof>, __name=0x555555706036 "stof",
__str=0x55555575ae60 "notanumber", __idx=0x0)
--Type <RET> for more, q to quit, c to continue without paging--c
at /usr/include/c++/9/ext/string_conversions.h:83
#8 0x000055555569190c in std::__cxx11::stof (__str="notanumber", __idx=0x0) at /usr/include/c++/9/bits/basic_string.h:6530
#9 0x00005555556b1240 in SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::write(std::shared_ptr<SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Session> const&, std::function<void (std::shared_ptr<SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response>, std::shared_ptr<SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Request>)>&)::{lambda(SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response*)#1}::operator()(SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response*) const::{lambda(boost::system::error_code const&)#1}::operator()(boost::system::error_code const) const (this=0x7fffffffd910, ec=...) at /home/dukelaze/Documents/dev/skole/TDAT3020-sikkerhet-i-programvare-og-nettverk/oving2/buggy-web-server/server_http.hpp:765
#10 0x00005555556bc680 in std::_Function_handler<void (boost::system::error_code const&), SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::write(std::shared_ptr<SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Session> const&, std::function<void (std::shared_ptr<SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response>, std::shared_ptr<SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Request>)>&)::{lambda(SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response*)#1}::operator()(SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response*) const::{lambda(boost::system::error_code const&)#1}>::_M_invoke(std::_Any_data const&, boost::system::error_code const&) (__functor=..., __args#0=...) at /usr/include/c++/9/bits/std_function.h:300
#11 0x00005555556bc807 in std::function<void (boost::system::error_code const&)>::operator()(boost::system::error_code const&) const (this=0x7fffffffd580, __args#0=...) at /usr/include/c++/9/bits/std_function.h:688
#12 0x00005555556b710f in SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}::operator()(boost::system::error_code const&, unsigned long) const (this=0x7fffffffd570, ec=...) at /home/dukelaze/Documents/dev/skole/TDAT3020-sikkerhet-i-programvare-og-nettverk/oving2/buggy-web-server/server_http.hpp:118
#13 0x00005555556d6d9b in boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>::operator()(boost::system::error_code const&, unsigned long, int) (this=0x7fffffffd558, ec=..., bytes_transferred=74, start=0) at /usr/include/boost/asio/impl/write.hpp:569
#14 0x00005555556f6dd0 in boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >::operator()(boost::system::error_code const&, unsigned long, int) (this=0x7fffffffd530, ec=..., bytes_transferred=74, start=0) at /usr/include/boost/asio/impl/write.hpp:338
#15 0x000055555570214a in boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>::operator()() (this=0x7fffffffd530) at /usr/include/boost/asio/detail/bind_handler.hpp:164
#16 0x0000555555702221 in boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long> >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, ...) (function=...) at /usr/include/boost/asio/handler_invoke_hook.hpp:69
#17 0x00005555557021b2 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code const&, unsigned long)#1}>(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, {lambda(boost::system::error_code const&, unsigned long)#1}&) (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#18 0x0000555555702178 in boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, {lambda(boost::system::error_code const&, unsigned long)#1}>(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, {lambda(boost::system::error_code const&, unsigned long)#1}>*) (function=..., this_handler=0x7fffffffd558) at /usr/include/boost/asio/impl/write.hpp:617
#19 0x0000555555702098 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}&) (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#20 0x0000555555701dcc in boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>*) (function=..., this_handler=0x7fffffffd530) at /usr/include/boost/asio/impl/write.hpp:393
#21 0x0000555555701c3b in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>&) (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#22 0x000055555570196e in boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>, boost::system::error_code, unsigned long>(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, boost::asio::detail::binder2<boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>, boost::system::error_code, unsigned long>*) (function=..., this_handler=0x7fffffffd530) at /usr/include/boost/asio/detail/bind_handler.hpp:207
#23 0x0000555555701682 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> > >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >&) (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#24 0x0000555555701433 in boost::asio::detail::io_object_executor<boost::asio::executor>::dispatch<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>, std::allocator<void> >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::system::error_code, unsigned long>&&, std::allocator<void> const&) const (this=0x7fffffffd520, f=..., a=...) at /usr/include/boost/asio/detail/io_object_executor.hpp:119
#25 0x0000555555701179 in boost::asio::detail::handler_work<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::asio::detail::io_object_executor<boost::asio::executor>, boost::asio::detail::io_object_executor>::complete<boost::asio::detail::binder2<boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>, boost::system::error_code, unsigned long> >(boost::asio::detail::binder2<boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>, boost::system::error_code, unsigned long>&, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}>&) (this=0x7fffffffd510, function=..., handler=...) at /usr/include/boost/asio/detail/handler_work.hpp:72
#26 0x0000555555700cd2 in boost::asio::detail::reactive_socket_send_op<boost::asio::const_buffers_1, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::write_dynbuf_v1_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::basic_streambuf_ref<std::allocator<char> >, boost::asio::detail::transfer_all_t, SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::Response::send_on_delete(std::function<void (boost::system::error_code const&)> const&)::{lambda(boost::system::error_code const&, unsigned long)#1}> >, boost::asio::detail::io_object_executor<boost::asio::executor> >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) (owner=0x55555575a640, base=0x55555575da60) at /usr/include/boost/asio/detail/reactive_socket_send_op.hpp:122
#27 0x0000555555693c64 in boost::asio::detail::scheduler_operation::complete (this=0x55555575da60, owner=0x55555575a640, ec=..., bytes_transferred=0) at /usr/include/boost/asio/detail/scheduler_operation.hpp:40
#28 0x0000555555699248 in boost::asio::detail::scheduler::do_run_one (this=0x55555575a640, lock=..., this_thread=..., ec=...) at /usr/include/boost/asio/detail/impl/scheduler.ipp:447
#29 0x0000555555698b84 in boost::asio::detail::scheduler::run (this=0x55555575a640, ec=...) at /usr/include/boost/asio/detail/impl/scheduler.ipp:200
#30 0x00005555556997a0 in boost::asio::io_context::run (this=0x55555575a620) at /usr/include/boost/asio/impl/io_context.ipp:63
#31 0x00005555556a679d in SimpleWeb::ServerBase<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::start(std::function<void (unsigned short)> const&) (this=0x7fffffffd910, callback=...) at /home/dukelaze/Documents/dev/skole/TDAT3020-sikkerhet-i-programvare-og-nettverk/oving2/buggy-web-server/server_http.hpp:463
#32 0x0000555555690dbd in main () at /home/dukelaze/Documents/dev/skole/TDAT3020-sikkerhet-i-programvare-og-nettverk/oving2/buggy-web-server/main.cpp:16
Possible solutions:
Handle the exception.
Use a different conversion method.
Do string comparisons.