From 6d66dbf4e82e7d6d42ef31a76adc92cb5f91df1e Mon Sep 17 00:00:00 2001 From: chengjinsong2 Date: Fri, 11 Aug 2023 17:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Duevent=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengjinsong2 --- ueventd/ueventd_device_handler.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ueventd/ueventd_device_handler.c b/ueventd/ueventd_device_handler.c index d39f3a36..604f0d4e 100644 --- a/ueventd/ueventd_device_handler.c +++ b/ueventd/ueventd_device_handler.c @@ -134,7 +134,9 @@ static void SetDeviceLable(const char *path, char **symLinks) if (strncmp(linkName, byNamePath, strlen(byNamePath)) == 0) { (void)Restorecon(linkName); lgetfilecon(linkName, &context); - setfilecon(path, context); + if (context != NULL) { + setfilecon(path, context); + } return; } } -- GitLab