From 781b821b0cfe047f339407362c0e187742f7079c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Thu, 5 Jun 2025 17:39:09 +0800 Subject: [PATCH] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- adapter/uhdf2/host/devhost.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adapter/uhdf2/host/devhost.c b/adapter/uhdf2/host/devhost.c index bea010327..097e0aee6 100644 --- a/adapter/uhdf2/host/devhost.c +++ b/adapter/uhdf2/host/devhost.c @@ -88,6 +88,10 @@ bool HdfStringToInt(const char *str, int *value) static void SetProcTitle(char **argv, const char *newTitle) { + if (newTitle == NULL) { + HDF_LOGE("failed because newTitle is NULL"); + return; + } size_t len = strlen(argv[0]); // 获取原始进程标题的长度 if (strlen(newTitle) > len) { // 如果新标题的长度超过原始标题的长度 HDF_LOGE("failed to set new process title because the '%{public}s' is too long", newTitle); // 打印错误日志 -- Gitee