Skip to content

Commit

Permalink
Replace strcpy with more secure strncpy (#331)
Browse files Browse the repository at this point in the history
Co-authored-by: prot0man <[email protected]>
  • Loading branch information
prot0man and prot0man authored Jan 12, 2024
1 parent 550905d commit 50f7250
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static int zip_archive_extract(mz_zip_archive *zip_archive, const char *dir,
#if defined(_MSC_VER)
strcpy_s(path, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE, dir);
#else
strcpy(path, dir);
strncpy(path, dir, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE);
#endif

if (!ISSLASH(path[dirlen - 1])) {
Expand Down

0 comments on commit 50f7250

Please sign in to comment.