1 Star 0 Fork 40

東東/lvm2

forked from src-openEuler/lvm2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0010-bugfix-lvm2-fix-the-reuse-of-va_list.patch 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
wguanghao 提交于 2022-09-16 14:56 . upgrade version to 2.03.16
From 70330d222e3231af111e9d7b500ed86e0980a2c6 Mon Sep 17 00:00:00 2001
From: wangjufeng <wangjufeng@huawei.com>
Date: Fri, 20 Mar 2020 19:28:02 +0800
Subject: [PATCH] lvm2: fix the reuse of va_list
After a va_list is used, it should not be used again. Because it
is already changed after using.
Signed-off-by: wangjufeng<wangjufeng@huawei.com>
---
libdm/libdm-common.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index 2fd8783..7f2fb81 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -113,6 +113,7 @@ static void _default_log_line(int level, const char *file,
int line, int dm_errno_or_class,
const char *f, va_list ap)
{
+ va_list copyap;
static int _abort_on_internal_errors = -1;
static int _debug_with_line_numbers = -1;
FILE *out = log_stderr(level) ? stderr : stdout;
@@ -131,8 +132,10 @@ static void _default_log_line(int level, const char *file,
if (_debug_with_line_numbers)
fprintf(out, "%s:%d ", file, line);
+ va_copy(copyap, ap);
vfprintf(out, f, ap);
- vsyslog(level, f, ap);
+ vsyslog(level, f, copyap);
+ va_end(copyap);
fputc('\n', out);
}
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/East_x/lvm2.git
git@gitee.com:East_x/lvm2.git
East_x
lvm2
lvm2
master

搜索帮助