From f3102b7e00574a8f9b7e949760509dab933639ae Mon Sep 17 00:00:00 2001 From: Michael Beale Date: Thu, 30 Oct 2025 17:03:16 -0700 Subject: [PATCH] Potential fix for code scanning alert no. 146: Unbounded write Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- async-toolkit/atools/lib/archive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/async-toolkit/atools/lib/archive.c b/async-toolkit/atools/lib/archive.c index ba17dba2e..f925ab859 100644 --- a/async-toolkit/atools/lib/archive.c +++ b/async-toolkit/atools/lib/archive.c @@ -120,13 +120,13 @@ void add_recent(char *archive, char *member, char *output) entry->uses=1; entry->archive=leak_realloc(entry->archive,strlen(archive)+1); - strcpy(entry->archive,archive); + strncpy(entry->archive,archive,strlen(archive)+1); entry->member=leak_realloc(entry->member,strlen(member)+1); - strcpy(entry->member,member); + strncpy(entry->member,member,strlen(member)+1); entry->output=leak_realloc(entry->output,strlen(output)+1); - strcpy(entry->output,output); + strncpy(entry->output,output,strlen(output)+1); } int archive_extract(char *archive, char *member, char *output)