From edf5b7cd038709daa396b5820ea5c349f7899249 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 2 Mar 2019 08:42:56 -0800 Subject: [PATCH] Fix HTTP parser static string calculation --- CHANGELOG.md | 1 + include/boost/beast/http/impl/fields.hpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aece344..fb8bee09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 226: * Support -fno-exceptions * make_strand is in net:: +* Fix HTTP parser static string calculation -------------------------------------------------------------------------------- diff --git a/include/boost/beast/http/impl/fields.hpp b/include/boost/beast/http/impl/fields.hpp index 77f151fe..9616af82 100644 --- a/include/boost/beast/http/impl/fields.hpp +++ b/include/boost/beast/http/impl/fields.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1018,7 +1019,8 @@ set_chunked_impl(bool value) itt = next; } static_string buf; - if(it->value().size() <= buf.size() + 9) + if(! beast::detail::sum_exceeds( + it->value().size(), 9u, buf.max_size())) { buf.append(it->value().data(), it->value().size()); buf.append(", chunked", 9);