From 21989a7899e09071a2ec9082d55fc85a30af9562 Mon Sep 17 00:00:00 2001 From: "Neil.wrz" Date: Thu, 4 May 2023 20:02:28 -0700 Subject: [PATCH] fix memrealloc size error Signed-off-by: Neil.wrz --- 0058-fix-memrealloc-size-error.patch | 27 +++++++++++++++++++++++++++ iSulad.spec | 9 ++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0058-fix-memrealloc-size-error.patch diff --git a/0058-fix-memrealloc-size-error.patch b/0058-fix-memrealloc-size-error.patch new file mode 100644 index 0000000..9d994d7 --- /dev/null +++ b/0058-fix-memrealloc-size-error.patch @@ -0,0 +1,27 @@ +From c376da6d86e52bb5eceaa8357b80e81591e05f7b Mon Sep 17 00:00:00 2001 +From: "Neil.wrz" +Date: Thu, 27 Apr 2023 05:20:31 -0700 +Subject: [PATCH 58/58] fix memrealloc size error + +Signed-off-by: Neil.wrz +--- + src/daemon/modules/service/service_container.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/daemon/modules/service/service_container.c b/src/daemon/modules/service/service_container.c +index 6dc06c83..9960ace1 100644 +--- a/src/daemon/modules/service/service_container.c ++++ b/src/daemon/modules/service/service_container.c +@@ -1580,7 +1580,8 @@ static int do_append_process_exec_env(const char **default_env, defs_process *sp + ret = -1; + goto out; + } +- new_size = (spec->env_len + default_env_len) * sizeof(char *); ++ // new_size = old_size + default_env_len + 1(null as terminator) ++ new_size = (spec->env_len + default_env_len + 1) * sizeof(char *); + old_size = spec->env_len * sizeof(char *); + ret = util_mem_realloc((void **)&temp, new_size, spec->env, old_size); + if (ret != 0) { +-- +2.25.1 + diff --git a/iSulad.spec b/iSulad.spec index bfa5fe2..a2d0a4d 100644 --- a/iSulad.spec +++ b/iSulad.spec @@ -1,5 +1,5 @@ %global _version 2.0.18 -%global _release 6 +%global _release 7 %global is_systemd 1 %global enable_shimv2 1 %global is_embedded 1 @@ -70,6 +70,7 @@ Patch0054: 0054-refactor-remote-ro-code.patch Patch0055: 0055-bugfix-when-refresh-can-t-load-or-pull-images.patch Patch0056: 0056-remove-unused-headers.patch Patch0057: 0057-change-isulad-shim-epoll-struct.patch +Patch0058: 0058-fix-memrealloc-size-error.patch %ifarch x86_64 aarch64 Provides: libhttpclient.so()(64bit) @@ -314,6 +315,12 @@ fi %endif %changelog +* Fri May 05 2023 wangrunze - 2.0.18-7 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: fix memrealloc size error + * Thu May 04 2023 zhangxiaoyu - 2.0.18-6 - Type: bugfix - ID: NA -- Gitee