From: Vincent Bernat Date: Wed, 26 Nov 2008 15:35:40 +0000 (+0100) Subject: Fix reception of LLDP-MED inventory: one byte was stripped X-Git-Tag: 0.3~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44cbe5680871d66193163263dfb29192964853bc;p=thirdparty%2Flldpd.git Fix reception of LLDP-MED inventory: one byte was stripped --- diff --git a/src/lldp.c b/src/lldp.c index 4d960032..d9805b8f 100644 --- a/src/lldp.c +++ b/src/lldp.c @@ -619,10 +619,10 @@ lldp_decode(struct lldpd *cfg, char *frame, int s, if (size <= 4) b = NULL; else { - b = (char*)malloc(size - 4); + b = (char*)malloc(size - 3); strlcpy(b, (char*)(frame + f), - size - 4); + size - 3); } switch (subtype) { case LLDP_TLV_MED_IV_HW: