From aa357d2b6b54c966353bcee4d7f14640540a8cf2 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 29 Jul 2016 22:10:21 +0200 Subject: [PATCH] lldp: skip empty LLDP-MED inventory TLV instead --- NEWS | 4 ++++ src/daemon/protocols/lldp.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 280299db..800fad8a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +lldpd (0.9.5): + * Fix: + + Skip empty LLDP-MED inventory TLV. + lldpd (0.9.4) * Change: + Make lldpd accepts a `-p` option to specify the PID file. diff --git a/src/daemon/protocols/lldp.c b/src/daemon/protocols/lldp.c index 59b9f1c2..ebe00d84 100644 --- a/src/daemon/protocols/lldp.c +++ b/src/daemon/protocols/lldp.c @@ -1064,7 +1064,8 @@ lldp_decode(struct lldpd *cfg, char *frame, int s, case LLDP_TLV_MED_IV_MODEL: case LLDP_TLV_MED_IV_ASSET: if (tlv_size <= 4) - b = NULL; + /* Empty TLV, skip it */ + break; else { if ((b = (char*)malloc(tlv_size - 3)) == NULL) { -- 2.39.5