From 5c774765616b219ddb293ebf37ba79a806523f11 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 22 Feb 2019 12:20:19 +0100 Subject: [HICN-80] Avoid segfault when deleting memif interface on VPP. Change-Id: Ie36cfc0ade82b38815d61a7ead2c72fc640236ed Signed-off-by: Mauro Sardara --- libtransport/src/hicn/transport/core/memif_connector.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libtransport/src/hicn/transport/core/memif_connector.cc') diff --git a/libtransport/src/hicn/transport/core/memif_connector.cc b/libtransport/src/hicn/transport/core/memif_connector.cc index c69a87fb7..af737412d 100644 --- a/libtransport/src/hicn/transport/core/memif_connector.cc +++ b/libtransport/src/hicn/transport/core/memif_connector.cc @@ -136,8 +136,7 @@ int MemifConnector::createMemif(uint32_t index, uint8_t mode, char *s) { args.buffer_size = MEMIF_BUF_SIZE; args.num_s2m_rings = 1; args.num_m2s_rings = 1; - strncpy((char *)args.interface_name, IF_NAME, strlen(IF_NAME)); - // strncpy((char *) args.instance_name, APP_NAME, strlen(APP_NAME)); + strncpy((char *)args.interface_name, IF_NAME, strlen(IF_NAME) + 1); args.mode = memif_interface_mode_t::MEMIF_INTERFACE_MODE_IP; args.socket_filename = (uint8_t *)socket_filename_.c_str(); -- cgit 1.2.3-korg