Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 2242bc12f -> 847f02417
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/develop Commit: 847f0241784e49a03cc44865d23958a126b3c210 Parents: 2242bc1 Author: Christopher Collins <[email protected]> Authored: Sat Mar 4 14:24:38 2017 -0800 Committer: Christopher Collins <[email protected]> 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 }, };
