From: Fl0-0 Date: Thu, 17 Jan 2019 08:13:38 +0000 (+0100) Subject: restore #755 reverted after #757 (#761) X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/d3c606574f90881daab8585659c18223a7a3c2c3?hp=151a33c02724869911f22ed6b1db502404fb8f0c restore #755 reverted after #757 (#761) --- diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 2eed6d3d..edd51b72 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -584,7 +584,7 @@ int CmdSmartUpgrade(const char *Cmd) { return 1; } - char sha512filename[FILE_PATH_SIZE]; + char sha512filename[FILE_PATH_SIZE] = {'\0'}; char *bin_extension = filename; char *dot_position = NULL; while ((dot_position = strchr(bin_extension, '.')) != NULL) { @@ -595,7 +595,7 @@ int CmdSmartUpgrade(const char *Cmd) { || !strcmp(bin_extension, "bin") #endif ) { - strncpy(sha512filename, filename, strlen(filename) - strlen("bin")); + memcpy(sha512filename, filename, strlen(filename) - strlen("bin")); strcat(sha512filename, "sha512.txt"); } else { PrintAndLogEx(FAILED, "Filename extension of Firmware Upgrade File must be .BIN");