mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-23 04:22:51 +00:00
coverity fix #308205
This commit is contained in:
1 parent
f65b5eb96d
commit
145a031922
1 file changed
+2
-5
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user