]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker: fixed receiving very large TCP payloads
authorMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 26 Nov 2015 21:11:51 +0000 (22:11 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 26 Nov 2015 21:11:51 +0000 (22:11 +0100)
daemon/worker.c
tests/deckard

index a2db66c7edf7a4500a6d4d27e797f4209a688875..36c97977e31e0196b50a2a25e8172e19e39d2568 100644 (file)
@@ -602,11 +602,7 @@ static int msg_size(const uint8_t *msg, size_t len)
                if (len < 2) {
                        return kr_error(EMSGSIZE);
                }
-               uint16_t nbytes = wire_read_u16(msg);
-               if (nbytes > len - 2) {
-                       return kr_error(EMSGSIZE);
-               }
-               return nbytes;
+               return wire_read_u16(msg);
 }
 
 int worker_process_tcp(struct worker_ctx *worker, uv_handle_t *handle, const uint8_t *msg, size_t len)
index 082b68253494d4959975c76342c7044273e2f993..178715a25997c63b79a58f1e2cbff49bb327ae02 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 082b68253494d4959975c76342c7044273e2f993
+Subproject commit 178715a25997c63b79a58f1e2cbff49bb327ae02