mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-08 20:29:40 +00:00
tools: acrn-crashlog: fix build warnings with gcc8.1.1
This patch is to fix the build warning with gcc8.1.1. Most of them are warnings for buffer overflow from snprintf and strncpy. Signed-off-by: CHEN Gang <gang.c.chen@intel.com> Reviewed-by: Zhi Jin <zhi.jin@intel.com> Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com> Reviewed-by: xiaojin2 <xiaojing.liu@intel.com>
This commit is contained in:
@@ -112,6 +112,7 @@ static int socket_bind(int fd, const char *name)
|
||||
if (name_len >= SUN_PATH_MAX)
|
||||
return -1;
|
||||
strncpy(addr.sun_path, name, SUN_PATH_MAX);
|
||||
addr.sun_path[SUN_PATH_MAX - 1] = '\0';
|
||||
unlink(addr.sun_path);
|
||||
alen = strlen(addr.sun_path) + sizeof(addr.sun_family);
|
||||
|
||||
|
Reference in New Issue
Block a user