40 lines
1.2 KiB
Diff
40 lines
1.2 KiB
Diff
From e724fefbd1cbaa610894eab418b3721e798a9c1f Mon Sep 17 00:00:00 2001
|
|
From: wo_cow <niuqianqian@huawei.com>
|
|
Date: Mon, 8 May 2023 19:41:04 +0800
|
|
Subject: [PATCH] fix access violation
|
|
|
|
---
|
|
src/common/container.c | 2 +-
|
|
src/common/container.h | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/common/container.c b/src/common/container.c
|
|
index c7981a1..fc081d3 100644
|
|
--- a/src/common/container.c
|
|
+++ b/src/common/container.c
|
|
@@ -486,7 +486,7 @@ int get_elf_path(unsigned int pid, char elf_path[], int max_path_len, const char
|
|
{
|
|
char cmd[COMMAND_LEN] = {0};
|
|
char elf_relative_path[PATH_LEN] = {0};
|
|
- char container_id[CONTAINER_ABBR_ID_LEN] = {0};
|
|
+ char container_id[CONTAINER_ABBR_ID_LEN + 1] = {0};
|
|
char container_path[PATH_LEN] = {0};
|
|
|
|
// 1. get elf_path
|
|
diff --git a/src/common/container.h b/src/common/container.h
|
|
index b2dade9..e06a64b 100644
|
|
--- a/src/common/container.h
|
|
+++ b/src/common/container.h
|
|
@@ -29,7 +29,7 @@ enum container_status_e {
|
|
|
|
typedef struct container_info_s {
|
|
enum container_status_e status;
|
|
- char abbrContainerId[CONTAINER_ID_LEN];
|
|
+ char abbrContainerId[CONTAINER_ID_LEN + 1];
|
|
} container_info;
|
|
|
|
typedef struct container_tbl_s {
|
|
--
|
|
2.33.0
|
|
|