From c166a030a1be0e4006605dd12190741986e0f9f2 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 27 Sep 2018 11:36:42 +0200 Subject: tools: Fix memleaks and buffer overflows in irm tool This fixes some memleaks and potential buffer overflows in the irm tool. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- include/ouroboros/ipcp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/ouroboros/ipcp.h') diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index c7013f08..e423a015 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -27,7 +27,7 @@ #include #include -#define LAYER_NAME_SIZE 256 +#define LAYER_NAME_SIZE 255 /* * NOTE: the IRMd uses this order to select an IPCP @@ -67,7 +67,7 @@ enum pol_dir_hash { /* Info reported back to the IRMd about the layer on enrollment */ struct layer_info { - char layer_name[LAYER_NAME_SIZE]; + char layer_name[LAYER_NAME_SIZE + 1]; int dir_hash_algo; }; -- cgit v1.2.3