lldpad/lldpad-0.9.41-lldptool-invalid-pointer.patch
2011-04-21 09:09:33 +02:00

14 lines
424 B
Diff

diff --git a/clif.c b/clif.c
index a6dc3d8..5fe9bd5 100644
--- a/clif.c
+++ b/clif.c
@@ -158,7 +158,7 @@ static int clif_attach_helper(struct clif *clif, char *tlvs_hex, int attach)
/* Allocate maximum buffer usage */
if (tlvs_hex && attach) {
- buf = malloc(sizeof(char)*(strlen(tlvs_hex) + 1));
+ buf = malloc(sizeof(char)*(strlen(tlvs_hex) + 2));
if (!buf)
return -1;
sprintf(buf, "%s%s","A",tlvs_hex);