Skip to content

Commit f3102b7

Browse files
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>
1 parent 2eae283 commit f3102b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

async-toolkit/atools/lib/archive.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ void add_recent(char *archive, char *member, char *output)
120120
entry->uses=1;
121121

122122
entry->archive=leak_realloc(entry->archive,strlen(archive)+1);
123-
strcpy(entry->archive,archive);
123+
strncpy(entry->archive,archive,strlen(archive)+1);
124124

125125
entry->member=leak_realloc(entry->member,strlen(member)+1);
126-
strcpy(entry->member,member);
126+
strncpy(entry->member,member,strlen(member)+1);
127127

128128
entry->output=leak_realloc(entry->output,strlen(output)+1);
129-
strcpy(entry->output,output);
129+
strncpy(entry->output,output,strlen(output)+1);
130130
}
131131

132132
int archive_extract(char *archive, char *member, char *output)

0 commit comments

Comments
 (0)