Skip to content

buffer overflow handling for string_body and mutable_body #553

@octopus-prime

Description

@octopus-prime

Beast/v70

Was looking at test coverage to find untested parts to increase coverage.
So i discovered this:

            try
            {
                body_.resize(len + n);
            }
            catch(std::length_error const&)
            {
                ec = error::buffer_overflow;
                return;
            }
            ec.assign(0, ec.category());

There you catch std::length_error only.
What about the exceptions thrown by corresponding Allocator?
e.g. std::bad_alloc

http://en.cppreference.com/w/cpp/string/basic_string/resize

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions