From: jsg Date: Wed, 27 Jul 2016 01:36:37 +0000 (+0000) Subject: zero sizeof a struct not sizeof the pointer to it X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=810ac3605ebb69f40bc4526e3910b84d9ebe01e1;p=openbsd zero sizeof a struct not sizeof the pointer to it ok mikeb@ --- diff --git a/sys/dev/pv/if_hvn.c b/sys/dev/pv/if_hvn.c index c3aebfa9fb9..9bcc1ffae2a 100644 --- a/sys/dev/pv/if_hvn.c +++ b/sys/dev/pv/if_hvn.c @@ -675,7 +675,7 @@ hvn_nvsp_attach(struct hvn_softc *sc) mtx_init(&sc->sc_nvsplck, IPL_NET); - memset(pkt, 0, sizeof(pkt)); + memset(pkt, 0, sizeof(*pkt)); pkt->msg_type = nvsp_type_init; init = (struct nvsp_init *)&pkt->msg; @@ -696,7 +696,7 @@ hvn_nvsp_attach(struct hvn_softc *sc) return (-1); } - memset(pkt, 0, sizeof(pkt)); + memset(pkt, 0, sizeof(*pkt)); pkt->msg_type = nvsp_type_send_ndis_vers; ver = (struct nvsp_send_ndis_version *)&pkt->msg; if (sc->sc_proto <= NVSP_PROTOCOL_VERSION_4)