Server crashes with string or too large number
Server crashes due to unhandled exceptions. Invalid argument exception for strings and out of range exception for too large numbers.
Either of these codes will recreate the crash:
GET / HTTP/9999999999999999999999999999999999
GET / HTTP/DontLetMeDownNow
Backtrace:
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 0x00007ffff7bc6859 in __GI_abort () at abort.c:79
#2 0x00007ffff7e4c951 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff7e5847c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff7e584e7 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff7e58799 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff7e4f30e 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=0x7ffff7bed6b0 <__GI_strtof>, __name=0x555555706036 "stof", __str=0x55555575ae60 "DontLetMeDown", __idx=0x0) at /usr/include/c++/9/ext/string_conversions.h:83
#8 0x000055555569190c in std::__cxx11::stof (__str="DontLetMeDown", __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=0x7fffffffdc00, ec=...) at /home/matholse/Skole/ComputerSecurity/Oving2/buggy-web-server/server_http.hpp:765