]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
restore #755 reverted after #757 (#761)
authorFl0-0 <Fl0-0@users.noreply.github.com>
Thu, 17 Jan 2019 08:13:38 +0000 (09:13 +0100)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Thu, 17 Jan 2019 08:13:38 +0000 (09:13 +0100)
client/cmdsmartcard.c

index 2eed6d3da562cddca340fa233c88782af94b1ce1..edd51b7237cea5dfedb75f427e1da767b2b7e770 100644 (file)
@@ -584,7 +584,7 @@ int CmdSmartUpgrade(const char *Cmd) {
                return 1;
        }
 
                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) {
        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
            ) {
            || !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");
                strcat(sha512filename, "sha512.txt");
        } else {
                PrintAndLogEx(FAILED, "Filename extension of Firmware Upgrade File must be .BIN");
Impressum, Datenschutz