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 2017/03/06 21:19:21 UTC

[45/50] incubator-mynewt-core git commit: MYNEWT-654 datetime command may crash device

MYNEWT-654 datetime command may crash device

There are two issues here:

1. newtmgr tool always includes an extraneous rc:0 key-value pair in its
   outgoing datetime commands.
2. Server-side, the firmware parses the "rc" value and writes the result
   to null.

This commit addresses the second issue as follows: Don't attempt to
parse the rc entry in incoming requests.


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/847f0241
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/847f0241
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/847f0241

Branch: refs/heads/master
Commit: 847f0241784e49a03cc44865d23958a126b3c210
Parents: 2242bc1
Author: Christopher Collins <cc...@apache.org>
Authored: Sat Mar 4 14:24:38 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Sat Mar 4 14:24:38 2017 -0800

----------------------------------------------------------------------
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/847f0241/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
----------------------------------------------------------------------
diff --git a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
index 2a75d47..b69766e 100644
--- a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
+++ b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
@@ -271,17 +271,13 @@ nmgr_datetime_set(struct mgmt_cbuf *cb)
     struct os_timezone tz;
     char buf[DATETIME_BUFSIZE];
     int rc = 0;
-    const struct cbor_attr_t datetime_write_attr[3] = {
+    const struct cbor_attr_t datetime_write_attr[] = {
         [0] = {
             .attribute = "datetime",
             .type = CborAttrTextStringType,
             .addr.string = buf,
             .len = sizeof(buf),
         },
-        [1] = {
-            .attribute = "rc",
-            .type = CborAttrIntegerType,
-        },
         { 0 },
     };