You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/08/18 16:57:19 UTC

[1/2] incubator-mynewt-core git commit: Don't read on-flash structures that extend beyond flash area

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 6e96e2673 -> c0f685b40


Don't read on-flash structures that extend beyond flash area

Data at the end of a flash area could be incorrectly parsed as valid structures.
Code was added to check for runoff past end of area.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/fd743673
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/fd743673
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/fd743673

Branch: refs/heads/develop
Commit: fd743673829b669bef90ae6d7bbd66a154d64ac7
Parents: fd187c1
Author: Peter Snyder <gi...@peterfs.com>
Authored: Tue Jul 26 00:35:35 2016 -0700
Committer: Peter Snyder <gi...@peterfs.com>
Committed: Tue Jul 26 00:35:35 2016 -0700

----------------------------------------------------------------------
 apps/ffs2native/src/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fd743673/apps/ffs2native/src/main.c
----------------------------------------------------------------------
diff --git a/apps/ffs2native/src/main.c b/apps/ffs2native/src/main.c
index 98493b0..19a5330 100644
--- a/apps/ffs2native/src/main.c
+++ b/apps/ffs2native/src/main.c
@@ -544,6 +544,7 @@ print_nffs_file_flash(char *flash_area, size_t size)
     struct nffs_disk_area *nda;
     int nad_cnt = 0;    /* Nffs Area Descriptor count */
     int off;
+    int objsz;
 
     daptr = flash_area;
     eoda = flash_area + size;
@@ -576,8 +577,13 @@ print_nffs_file_flash(char *flash_area, size_t size)
                    nda->nda_ver != NFFS_AREA_VER ? " (V0)" : "",
                    nad_cnt == file_scratch_idx ? " (Scratch)" : "");
 
+            if (nffs_version == 0) {
+                objsz = sizeof (struct nffs_disk_V0object);
+            } else {
+                objsz = sizeof (struct nffs_disk_object);
+            }
             off = sizeof (struct nffs_disk_area);
-            while (off < area_descs[nad_cnt].nad_length) {
+            while (off + objsz < area_descs[nad_cnt].nad_length) {
                 if (nffs_version == 0) {
                     off += print_nffs_flash_V0object(&area_descs[nad_cnt], off);
                 } else if (nffs_version == NFFS_AREA_VER) {


[2/2] incubator-mynewt-core git commit: This closes #81.

Posted by ma...@apache.org.
This closes #81.

Merge branch 'nffs-update' of https://github.com/peterfs/incubator-mynewt-core into develop


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/c0f685b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c0f685b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c0f685b4

Branch: refs/heads/develop
Commit: c0f685b406bcf9f54a374b6ce122bca76d1c51c2
Parents: 6e96e26 fd74367
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Aug 18 09:56:32 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Aug 18 09:56:32 2016 -0700

----------------------------------------------------------------------
 apps/ffs2native/src/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------