You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/09/14 09:32:56 UTC

[GitHub] andrzej-kaczmarek closed pull request #9: bugfix: during inode update the file name might be corrupted

andrzej-kaczmarek closed pull request #9: bugfix: during inode update the file name might be corrupted
URL: https://github.com/apache/mynewt-nffs/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/nffs_inode.c b/src/nffs_inode.c
index 10776b6..814e5fe 100644
--- a/src/nffs_inode.c
+++ b/src/nffs_inode.c
@@ -641,7 +641,7 @@ nffs_inode_update(struct nffs_inode_entry *inode_entry)
     struct nffs_inode inode;
     uint32_t area_offset;
     uint8_t area_idx;
-    char *filename;
+    char filename[NFFS_INODE_FILENAME_BUF_SZ];
     int filename_len;
     int rc;
 
@@ -664,13 +664,11 @@ nffs_inode_update(struct nffs_inode_entry *inode_entry)
     STATS_INC(nffs_stats, nffs_readcnt_update);
     rc = nffs_flash_read(area_idx,
                          area_offset + sizeof (struct nffs_disk_inode),
-                         nffs_flash_buf, filename_len);
+                         filename, filename_len);
     if (rc != 0) {
         return rc;
     }
 
-    filename = (char *)nffs_flash_buf;
-
     rc = nffs_misc_reserve_space(sizeof disk_inode + filename_len,
                                  &area_idx, &area_offset);
     if (rc != 0) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services