Blame SOURCES/0002-check-whether-savedptr-is-NULL-before-invoking-strle.patch

8dca8a
From 522883505d3b02e3294f045f49007b61c00e2c31 Mon Sep 17 00:00:00 2001
8dca8a
From: Chao Liu <liuchao173@huawei.com>
8dca8a
Date: Wed, 8 Jun 2022 10:04:02 +0800
8dca8a
Subject: [PATCH 02/14] check whether savedptr is NULL before invoking strlen
8dca8a
8dca8a
savedptr can be null in musl libc, so the strlen(NULL) will segfault
8dca8a
8dca8a
Signed-off-by: Chao Liu <liuchao173@huawei.com>
8dca8a
---
8dca8a
 procinterrupts.c | 2 +-
8dca8a
 1 file changed, 1 insertion(+), 1 deletion(-)
8dca8a
8dca8a
diff --git a/procinterrupts.c b/procinterrupts.c
8dca8a
index 9015177..57c8801 100644
8dca8a
--- a/procinterrupts.c
8dca8a
+++ b/procinterrupts.c
8dca8a
@@ -178,7 +178,7 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq)
8dca8a
 	}
8dca8a
 
8dca8a
 #ifdef AARCH64
8dca8a
-	if (strlen(savedptr) > 0) {
8dca8a
+	if (savedptr && strlen(savedptr) > 0) {
8dca8a
 		snprintf(irq_fullname, PATH_MAX, "%s %s", last_token, savedptr);
8dca8a
 		tmp = strchr(irq_fullname, '\n');
8dca8a
 		if (tmp)
8dca8a
-- 
8dca8a
2.33.1
8dca8a