[riot-commits] [RIOT-OS/RIOT] 11ce19: cbor: compare asserted lengths in unit test

Oleg Hahm oleg at hobbykeller.org
Tue Sep 22 11:43:22 CEST 2015


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 11ce199c413040a399fad9e3a5ebc2876bdd29a5
      https://github.com/RIOT-OS/RIOT/commit/11ce199c413040a399fad9e3a5ebc2876bdd29a5
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2015-08-25 (Tue, 25 Aug 2015)

  Changed paths:
    M tests/unittests/tests-cbor/tests-cbor.c

  Log Message:
  -----------
  cbor: compare asserted lengths in unit test

In `test_array`, `test_array` and `test_map` the variable `offset` was
written to but not read. The accumulated value should equal the total
length of the input. This diff adds this check and fixes the warning
in turn.

Found via scan-build.


  Commit: 80fe12e48378356c127bb09251a70965fe88c14b
      https://github.com/RIOT-OS/RIOT/commit/80fe12e48378356c127bb09251a70965fe88c14b
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2015-08-25 (Tue, 25 Aug 2015)

  Changed paths:
    M sys/ubjson/ubjson-read.c

  Log Message:
  -----------
  ubjson: initialize variable in error case too

For an invalid input `ubjson_get_i32()` did not return a proper error
code. Because of that `_ubjson_read_length()` could have operated on
uninitialized data.

Found via scan-build.


  Commit: 2e3a636b7eb1a866fb136fe359d8097481000709
      https://github.com/RIOT-OS/RIOT/commit/2e3a636b7eb1a866fb136fe359d8097481000709
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2015-08-25 (Tue, 25 Aug 2015)

  Changed paths:
    M sys/embunit/stdImpl.c

  Log Message:
  -----------
  embUnit: simplify `strcmp()` implementation

The logic of `stdimpl_strcmp()` was needlessly complicated and not
understood by scan-build. This change fixes the warning and makes the
code more readable.

Found via scan-build.


  Commit: 05eb6e73d937999dd1be6a484c0d2a5ee592989d
      https://github.com/RIOT-OS/RIOT/commit/05eb6e73d937999dd1be6a484c0d2a5ee592989d
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2015-09-22 (Tue, 22 Sep 2015)

  Changed paths:
    M sys/bloom/bloom.c

  Log Message:
  -----------
  bloom: fix calloc invocation

Fix array member type (`char` vs `uint8_t`).

Found via scan-build.


  Commit: 7af7d37531f8d44d4bf343be2197e4952ca188f7
      https://github.com/RIOT-OS/RIOT/commit/7af7d37531f8d44d4bf343be2197e4952ca188f7
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2015-09-22 (Tue, 22 Sep 2015)

  Changed paths:
    M sys/base64/base64.c

  Log Message:
  -----------
  base64: remove unused calculation in base64_encode

Found via scan-build.


  Commit: d2afdf50799f02c77e34f7073b79c083a9762bfd
      https://github.com/RIOT-OS/RIOT/commit/d2afdf50799f02c77e34f7073b79c083a9762bfd
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2015-09-22 (Tue, 22 Sep 2015)

  Changed paths:
    M sys/crypto/modes/ccm.c

  Log Message:
  -----------
  crypto: `memcpy()` in overlapping data in ccm

`memcpy()` must not be used if the input and output ranges overlap,
because it is undefined if the data if copied from front to the end or
vice versa.

Found via valgrind.


  Commit: a0957b11d661b1d2e34843220f2cf03eb9f3dc94
      https://github.com/RIOT-OS/RIOT/commit/a0957b11d661b1d2e34843220f2cf03eb9f3dc94
  Author: Oleg Hahm <oleg at hobbykeller.org>
  Date:   2015-09-22 (Tue, 22 Sep 2015)

  Changed paths:
    M sys/base64/base64.c
    M sys/bloom/bloom.c
    M sys/crypto/modes/ccm.c
    M sys/embunit/stdImpl.c
    M sys/ubjson/ubjson-read.c
    M tests/unittests/tests-cbor/tests-cbor.c

  Log Message:
  -----------
  Merge pull request #3926 from OlegHahm/some-scan-build-warnings

clean up: Some scan build warnings


Compare: https://github.com/RIOT-OS/RIOT/compare/3448569eb8d9...a0957b11d661


More information about the commits mailing list