Skip to content

Server will core-dump when an invalid http request was received #497

@wujunzhuo

Description

@wujunzhuo

I used gdb to debug the problem, and found that an exception was thrown in u8_to_u32_iterator::invalid_sequence() [boost/regex/pending/unicode_iterator.hpp], which was called in parse_headers() [boost/network/protocol/http/server/impl/parsers.ipp]. The program didn't catch the exception, so it lead to crash.

An easy way to fix the bug is to catch the exception in handle_read_data(), and then return Bad Request to clients.

boost version: 1.57
cpp-netlib version: 0.11-devel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions