projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix CmdSmartUpgrade GCC8 strncpy specified bound depends on the length of the source...
[proxmark3-svn]
/
client
/
cmdsmartcard.c
diff --git
a/client/cmdsmartcard.c
b/client/cmdsmartcard.c
index 80cbec462f79d6f0c30aa77f79fdf114fc2b571e..8f3d8d2e5d08e40663f394a3f2e38e53ed3b87bd 100644
(file)
--- a/
client/cmdsmartcard.c
+++ b/
client/cmdsmartcard.c
@@
-581,7
+581,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) {
@@
-592,7
+592,7
@@
int CmdSmartUpgrade(const char *Cmd) {
|| !strcmp(bin_extension, "bin")
#endif
) {
|| !strcmp(bin_extension, "bin")
#endif
) {
-
strn
cpy(sha512filename, filename, strlen(filename) - strlen("bin"));
+
mem
cpy(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