mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
runtime: call initRand() before initHeap() during initialization.
The reason is that allocating without a heap is usually more visible than using an uninitialized random generator which is subtle and may lead to security vulnerabilities. Based on suggestion from @eliasnaur Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -21,8 +21,8 @@ var schedulerExit bool
|
||||
// run is called by the program entry point to execute the go program.
|
||||
// With the "none" scheduler, init and the main function are invoked directly.
|
||||
func run() {
|
||||
initHeap()
|
||||
initRand()
|
||||
initHeap()
|
||||
initAll()
|
||||
callMain()
|
||||
mainExited = true
|
||||
|
||||
Reference in New Issue
Block a user