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

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