代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rpm 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6d7fa91949337c7a86bab3359b39558fdae07dce Mon Sep 17 00:00:00 2001
From: Michael Schroeder <[email protected]>
Date: Fri, 23 Oct 2020 14:02:35 +0200
Subject: [PATCH] Fix logic error in grabArgs()
If there was a \ at the end of the buffer, the code would
return a pointer after the trailing \0 leading to unallocated
memory access and weird results in some cases.
See commit 817959609b95afe34ce0f7f6c3dc5d7d0d9a8470.
---
rpmio/macro.c | 2 +-
tests/rpmmacro.at | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 1edcb39e6..a1ed9b288 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -947,7 +947,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
splitQuoted(&argv, s, " \t");
free(s);
- cont = ((*lastc == '\0' || *lastc == '\n') && *(lastc-1) != '\\') ?
+ cont = (*lastc == '\0') || (*lastc == '\n' && *(lastc-1) != '\\') ?
lastc : lastc + 1;
}
diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at
index d972a1197..a21952c46 100644
--- a/tests/rpmmacro.at
+++ b/tests/rpmmacro.at
@@ -179,6 +179,9 @@ runroot rpm \
--eval '%foo %{quote: 2 3 5} %{quote:%{nil}}' \
--eval '%foo x%{quote:y}z 123' \
--eval '%foo x%{quote:%{nil}}z' \
+ --eval '%foo 1 \
+bar' \
+ --eval '%foo 1 \' \
],
[0],
[1:"1"
@@ -190,6 +193,8 @@ runroot rpm \
2:" 2 3 5" ""
2:"xyz" "123"
1:"xz"
+2:"1" "\"bar
+2:"1" "\"
])
AT_CLEANUP
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。