From: Vincent Bernat Date: Sun, 21 Mar 2021 14:20:20 +0000 (+0100) Subject: daemon: fix some coverity annotations X-Git-Tag: 1.0.9~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=109c41b9db51360ab473ca75f5b3f11c824adf48;p=thirdparty%2Flldpd.git daemon: fix some coverity annotations --- diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index 282cbcd1..efc06c80 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -379,7 +379,7 @@ lldpd_reset_timer(struct lldpd *cfg) ssize_t output_len; char save[LLDPD_PORT_START_MARKER]; memcpy(save, port, sizeof(save)); - /* coverity[suspicious_sizeof] + /* coverity[sizeof_mismatch] We intentionally partially memset port */ memset(port, 0, sizeof(save)); output_len = lldpd_port_serialize(port, (void**)&output); @@ -705,9 +705,10 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s, freed with lldpd_port_cleanup() and therefore, the refcount of the chassis that was attached to it is decreased. */ + i = 0; /* coverity[use_after_free] TAILQ_REMOVE does the right thing */ - i = 0; TAILQ_FOREACH(aport, &hardware->h_rports, p_entries) + TAILQ_FOREACH(aport, &hardware->h_rports, p_entries) i++; log_debug("decode", "%d neighbors for %s", i, hardware->h_ifname);