]> granicus.if.org Git - gc/commit
Workaround 'insecure libc pseudo-random number generator used' code defect
authorIvan Maidanski <ivmai@mail.ru>
Fri, 28 Oct 2016 07:57:20 +0000 (10:57 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 28 Oct 2016 08:27:22 +0000 (11:27 +0300)
commit4918afb25a2ee683036ef2c0aba005c4edef89da
tree30348cb8df93f08763cc7c2e8fc67c2f6a52d44d
parent65347c05120cc72eb8a34a67b940d817372743ae
Workaround 'insecure libc pseudo-random number generator used' code defect

* dbg_mlc.c [LINT2] (GC_random): New function.
* dbg_mlc.c [KEEP_BACK_PTRS && LINT2] (RANDOM): Define to GC_random.
* dbg_mlc.c [KEEP_BACK_PTRS && LINT2]: Do not include stdlib.h.
* dbg_mlc.c [KEEP_BACK_PTRS && !LINT2] (GC_RAND_MAX): Define.
* dbg_mlc.c (GC_generate_random_heap_address): Replace RAND_MAX with
GC_RAND_MAX.
* include/private/gc_priv.h [LINT2] (GC_RAND_MAX): New macro.
* include/private/gc_priv.h [LINT2] (GC_random): Prototype (as
GC_API_PRIV).
* tests/disclaim_bench.c [LINT2] (rand): Redefine to GC_random.
* tests/disclaim_test.c [LINT2] (rand): Likewise.
* tests/disclaim_test.c [LINT2]: Include private/gc_priv.h instead of
config.h.
dbg_mlc.c
include/private/gc_priv.h
tests/disclaim_bench.c
tests/disclaim_test.c