代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/m4 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a886ea40a29a08954ff80772e267828a1d440cc9 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Fri, 13 Jan 2023 16:27:54 -0600
Subject: [PATCH] output: Avoid tickling UBSAN with memcpy(dest, NULL, 0)
Even though all libc handle it sanely (because size 0 says there is
nothing to copy), NULL is not a valid source pointer per a strict
reading of C, so UBSAN flags it:
+output.c:511:9: runtime error: null pointer passed as argument 2, which is declared to never be null
* src/output.c (make_room_for): Skip no-op memcpy.
Fixes: https://savannah.gnu.org/support/index.php?110809
Reported-by: Sam James
---
src/output.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/output.c b/src/output.c
index 956089b1..6dc8280a 100644
--- a/src/output.c
+++ b/src/output.c
@@ -508,7 +508,8 @@ make_room_for (int length)
{
char *buffer = output_diversion->u.buffer;
output_diversion->u.buffer = xcharalloc ((size_t) wanted_size);
- memcpy (output_diversion->u.buffer, buffer, output_diversion->used);
+ if (output_diversion->used)
+ memcpy (output_diversion->u.buffer, buffer, output_diversion->used);
free (buffer);
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。