From e94c67e2c6a867472008aa81d62cf334c0780893 Mon Sep 17 00:00:00 2001 From: AKuHAK <621640+AKuHAK@users.noreply.github.com> Date: Sun, 15 Mar 2026 12:40:17 +0200 Subject: [PATCH] Fix apaRename function to properly clear and copy newId to header --- iop/hdd/apa/src/hdd_fio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iop/hdd/apa/src/hdd_fio.c b/iop/hdd/apa/src/hdd_fio.c index ca590573488..ff75507c91c 100644 --- a/iop/hdd/apa/src/hdd_fio.c +++ b/iop/hdd/apa/src/hdd_fio.c @@ -559,7 +559,8 @@ static int apaRename(s32 device, const char *oldId, const char *newId) } // do the renaming :) note: subs have no names!! - memcpy(clink->header->id, newId, APA_IDMAX); + memset(clink->header->id, 0, APA_IDMAX); + strncpy(clink->header->id, newId, APA_IDMAX - 1); // touch creation time apaGetTime(&clink->header->created);