From 499c2eb2bb27a61c7b2ce9613b53cf331d58a767 Mon Sep 17 00:00:00 2001
From: Armin Luntzer <armin.luntzer@univie.ac.at>
Date: Tue, 4 Aug 2020 13:55:54 +0200
Subject: [PATCH] fix packet size allocation

---
 GRESB/gresb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GRESB/gresb.c b/GRESB/gresb.c
index 78f9b8b..40e53ba 100644
--- a/GRESB/gresb.c
+++ b/GRESB/gresb.c
@@ -139,7 +139,7 @@ uint8_t *gresb_create_host_data_pkt(const uint8_t *data, uint32_t len)
 	struct host_to_gresb_pkt *pkt;
 
 
-	pkt = malloc(sizeof(struct host_to_gresb_pkt));
+	pkt = malloc(sizeof(struct host_to_gresb_pkt) + len);
 	if (!pkt)
 		return NULL;
 
-- 
GitLab