代码拉取完成,页面将自动刷新
From 76846ec3b8740794b5c75934e8a24c07e6cf70bd Mon Sep 17 00:00:00 2001
From: Aristeu Rozanski <[email protected]>
Date: Thu, 19 Jan 2023 08:45:57 -0500
Subject: [PATCH 02/85] rasdaemon: ras-memory-failure-handler: handle
localtime() failure correctly
We could just have an empty string but keeping the format could prevent
issues if someone is actually parsing this.
Found with covscan.
v2: fixed the timestamp as pointed by Robert Elliott
Signed-off-by: Aristeu Rozanski <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
ras-memory-failure-handler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ras-memory-failure-handler.c b/ras-memory-failure-handler.c
index 9941e68..1951456 100644
--- a/ras-memory-failure-handler.c
+++ b/ras-memory-failure-handler.c
@@ -148,6 +148,8 @@ int ras_memory_failure_event_handler(struct trace_seq *s,
if (tm)
strftime(ev.timestamp, sizeof(ev.timestamp),
"%Y-%m-%d %H:%M:%S %z", tm);
+ else
+ strncpy(ev.timestamp, "1970-01-01 00:00:00 +0000", sizeof(ev.timestamp));
trace_seq_printf(s, "%s ", ev.timestamp);
if (pevent_get_field_val(s, event, "pfn", record, &val, 1) < 0)
--
2.33.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。