From: Vincent Bernat Date: Fri, 29 Jul 2016 20:10:21 +0000 (+0200) Subject: lldp: skip empty LLDP-MED inventory TLV instead X-Git-Tag: 0.9.5~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa357d2b6b54c966353bcee4d7f14640540a8cf2;p=thirdparty%2Flldpd.git lldp: skip empty LLDP-MED inventory TLV instead --- 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) {