kernel: refactor CMD_GET_FULL_VERSION to safely initialize version string (#220)

Use strscpy()/strlcpy() to populate the version buffer in CMD_GET_FULL_VERSION
instead of relying on uninitialized memory. This ensures the returned string
is null-terminated and avoids exposing garbage data to user space.

Signed-off-by: schqiushui <orochi9999@gmail.com>
This commit is contained in:
古塵
2025-06-27 00:23:12 +08:00
committed by ShirkNeko
parent d3c9b6e739
commit 4532bab230
4 changed files with 38 additions and 33 deletions

View File

@@ -519,7 +519,7 @@ fn do_patch(
let no_vendor_init_boot = !workdir
.join("vendor_ramdisk")
.join("init_boot.cpio")
.exists();Add commentMore actions
.exists();
if no_ramdisk && no_vendor_init_boot {
bail!("No compatible ramdisk found.");
}