mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
coverity fix #308205
This commit is contained in:
parent
f65b5eb96d
commit
145a031922
1 changed files with 2 additions and 5 deletions
|
@ -170,12 +170,9 @@ static void save_to_flash(uint8_t *data, uint16_t datalen, char *filename) {
|
|||
data[4], data[5], data[6], data[7]
|
||||
);
|
||||
} else {
|
||||
int name_len = SPIFFS_OBJ_NAME_LEN;
|
||||
int filename_len = strlen(filename);
|
||||
|
||||
int fnlen = MIN(strlen(filename), SPIFFS_OBJ_NAME_LEN);
|
||||
// if the given name len longer than buffer allows, cut it down to size
|
||||
name_len = (name_len >= SPIFFS_OBJ_NAME_LEN) ? SPIFFS_OBJ_NAME_LEN : filename_len;
|
||||
memcpy(fn, filename, name_len);
|
||||
memcpy(fn, filename, fnlen);
|
||||
}
|
||||
|
||||
int res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue