From 13988d25613d79a2124dad2eb854c9ad36b723cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=82=A3=E5=87=A0?= <2078634206@qq.com> Date: Wed, 30 Sep 2026 13:08:26 +0800 Subject: [PATCH] fix(ll-init): make the no-arguments check reachable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parse_args() always appended the terminating nullptr, so running ll-init without arguments produced {nullptr} instead of an empty vector; the "no arguments provided" branches in both callers were unreachable and execution fell through to execvp with a null file name; return an empty vector when no arguments exist. Signed-off-by: 陈那几 <2078634206@qq.com> --- apps/ll-init/src/ll-init.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/ll-init/src/ll-init.cpp b/apps/ll-init/src/ll-init.cpp index b159a4409..3103526f1 100644 --- a/apps/ll-init/src/ll-init.cpp +++ b/apps/ll-init/src/ll-init.cpp @@ -644,6 +644,10 @@ std::vector parse_args(int argc, char *argv[]) noexcept args.emplace_back(argv[i]); } + if (args.empty()) { + return args; + } + args.emplace_back(nullptr); return args; }