commit 6084a9a5ba263ddc8cd67f7e03f2ee0481d4ea77 from: Omar Polo date: Sun Mar 27 12:52:58 2022 UTC prefer sizeof(x) instead of datalen commit - 62a46b03c6f911f3674d6cb7b77a49bac8efad42 commit + 6084a9a5ba263ddc8cd67f7e03f2ee0481d4ea77 blob - 425c7fe3946e7f31b7a79eac350207390fde3cb9 blob + fbda0b5850083353a621bd68d3caaf3f8f0bf5c2 --- ex.c +++ ex.c @@ -288,7 +288,7 @@ handle_imsg_cgi_req(struct imsgbuf *ibuf, struct imsg if (datalen != sizeof(req)) abort(); - memcpy(&req, imsg->data, datalen); + memcpy(&req, imsg->data, sizeof(req)); iri.schema = req.iri_schema_off + req.buf; iri.host = req.iri_host_off + req.buf; @@ -409,7 +409,7 @@ handle_imsg_fcgi_req(struct imsgbuf *ibuf, struct imsg if (datalen != sizeof(id)) abort(); - memcpy(&id, imsg->data, datalen); + memcpy(&id, imsg->data, sizeof(id)); if (id > FCGI_MAX || (fcgi[id].path == NULL && fcgi[id].prog == NULL)) abort();