mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
consider null termination
This commit is contained in:
parent
fb7728974e
commit
8c4a42ff36
2 changed files with 3 additions and 3 deletions
|
@ -749,7 +749,7 @@ static s32_t spiffs_stat_pix(spiffs *fs, spiffs_page_ix pix, spiffs_file fh, spi
|
||||||
s->type = objix_hdr.type;
|
s->type = objix_hdr.type;
|
||||||
s->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size;
|
s->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size;
|
||||||
s->pix = pix;
|
s->pix = pix;
|
||||||
strncpy((char *)s->name, (char *)objix_hdr.name, SPIFFS_OBJ_NAME_LEN);
|
strncpy((char *)s->name, (char *)objix_hdr.name, SPIFFS_OBJ_NAME_LEN - 1);
|
||||||
#if SPIFFS_OBJ_META_LEN
|
#if SPIFFS_OBJ_META_LEN
|
||||||
_SPIFFS_MEMCPY(s->meta, objix_hdr.meta, SPIFFS_OBJ_META_LEN);
|
_SPIFFS_MEMCPY(s->meta, objix_hdr.meta, SPIFFS_OBJ_META_LEN);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -944,7 +944,7 @@ s32_t spiffs_object_create(
|
||||||
oix_hdr.p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED);
|
oix_hdr.p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED);
|
||||||
oix_hdr.type = type;
|
oix_hdr.type = type;
|
||||||
oix_hdr.size = SPIFFS_UNDEFINED_LEN; // keep ones so we can update later without wasting this page
|
oix_hdr.size = SPIFFS_UNDEFINED_LEN; // keep ones so we can update later without wasting this page
|
||||||
strncpy((char *)oix_hdr.name, (const char *)name, SPIFFS_OBJ_NAME_LEN);
|
strncpy((char *)oix_hdr.name, (const char *)name, SPIFFS_OBJ_NAME_LEN - 1);
|
||||||
#if SPIFFS_OBJ_META_LEN
|
#if SPIFFS_OBJ_META_LEN
|
||||||
if (meta) {
|
if (meta) {
|
||||||
_SPIFFS_MEMCPY(oix_hdr.meta, meta, SPIFFS_OBJ_META_LEN);
|
_SPIFFS_MEMCPY(oix_hdr.meta, meta, SPIFFS_OBJ_META_LEN);
|
||||||
|
@ -1007,7 +1007,7 @@ s32_t spiffs_object_update_index_hdr(
|
||||||
|
|
||||||
// change name
|
// change name
|
||||||
if (name) {
|
if (name) {
|
||||||
strncpy((char *)objix_hdr->name, (const char *)name, SPIFFS_OBJ_NAME_LEN);
|
strncpy((char *)objix_hdr->name, (const char *)name, SPIFFS_OBJ_NAME_LEN - 1);
|
||||||
}
|
}
|
||||||
#if SPIFFS_OBJ_META_LEN
|
#if SPIFFS_OBJ_META_LEN
|
||||||
if (meta) {
|
if (meta) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue