Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 62943fbe0 -> 1a14ba8b6
Fix memory overwrite in random number generation code. This overwrite could cause privacy to fail 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/1a14ba8b Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1a14ba8b Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1a14ba8b Branch: refs/heads/develop Commit: 1a14ba8b6ad67acd89fec59d9d43b3eefa22f9b4 Parents: 62943fb Author: William San Filippo <[email protected]> Authored: Fri Jul 29 08:33:30 2016 -0700 Committer: William San Filippo <[email protected]> Committed: Fri Jul 29 08:33:30 2016 -0700 ---------------------------------------------------------------------- net/nimble/controller/src/ble_ll_rand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1a14ba8b/net/nimble/controller/src/ble_ll_rand.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll_rand.c b/net/nimble/controller/src/ble_ll_rand.c index c5201f9..8d26f8d 100644 --- a/net/nimble/controller/src/ble_ll_rand.c +++ b/net/nimble/controller/src/ble_ll_rand.c @@ -37,7 +37,8 @@ struct ble_ll_rnum_data struct ble_ll_rnum_data g_ble_ll_rnum_data; uint8_t g_ble_ll_rnum_buf[NIMBLE_OPT_LL_RNG_BUFSIZE]; -#define IS_RNUM_BUF_END(x) (x == &g_ble_ll_rnum_buf[NIMBLE_OPT_LL_RNG_BUFSIZE]) +#define IS_RNUM_BUF_END(x) \ + (x == &g_ble_ll_rnum_buf[NIMBLE_OPT_LL_RNG_BUFSIZE - 1]) void ble_ll_rand_sample(uint8_t rnum)
