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

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