diff --git a/src/http.cpp b/src/http.cpp index 49a3075..b6916bb 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -48,14 +48,20 @@ const Request http::parse_request(const string &request) answer = get_parameter(request, "s"); if (!answer.empty()) { - size = static_cast(std::stoul(answer)); + try + { + size = static_cast(std::stoul(answer)); + } catch (const std::exception &) {} } else { answer = get_parameter(request, "size"); if (!answer.empty()) { - size = static_cast(std::stoul(answer)); + try + { + size = static_cast(std::stoul(answer)); + } catch (const std::exception &) {} } } if (size > 512)