]> git.meshlink.io Git - meshlink/commitdiff
Don't abort on empty lines in receive_request().
authorGuus Sliepen <guus@meshlink.io>
Fri, 6 Mar 2020 22:24:49 +0000 (23:24 +0100)
committerGuus Sliepen <guus@meshlink.io>
Fri, 6 Mar 2020 22:24:49 +0000 (23:24 +0100)
Remove the assertion that lines are not empty, since this could lead to
a DoS attack. Empty lines are already handled correctly by the rest of
the logic in receive_request().

src/protocol.c

index fa1dc13786b4a30cb02cfe079a2a06b37ecf8925..b4cb5ad5e2af15ebdd8c83812e5f965ab05990ff 100644 (file)
@@ -129,7 +129,6 @@ void forward_request(meshlink_handle_t *mesh, connection_t *from, submesh_t *s,
 
 bool receive_request(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        assert(request);
-       assert(*request);
 
        if(c->outgoing && mesh->proxytype == PROXY_HTTP && c->allow_request == ID) {
                if(!request[0] || request[0] == '\r') {