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

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