~ chicken-core (chicken-5) 41489039e994bdd2981686b89a61ade2da25b93a
commit 41489039e994bdd2981686b89a61ade2da25b93a
Author: Peter Bex <peter@more-magic.net>
AuthorDate: Fri Jun 30 15:39:45 2017 +0200
Commit: Peter Bex <peter@more-magic.net>
CommitDate: Sun Jul 16 20:20:28 2017 +0200
Initialize symbol table after setting up randomization
Otherwise, the symbol table wouldn't be correctly randomized.
Signed-off-by: felix <felix@call-with-current-continuation.org>
diff --git a/NEWS b/NEWS
index 1c016a19..e42566a8 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@
buffer overrun and/or segfault (thanks to Lemonboy).
- CVE-2017-9334: `length' no longer crashes on improper lists (fixes
#1375, thanks to "megane").
+ - The randomization factor of the symbol table was set before
+ the random seed was set, causing it to have a fixed value on many
+ platforms.
- Core Libraries
- Unit "posix": If file-lock, file-lock/blocking or file-unlock are
diff --git a/runtime.c b/runtime.c
index 7a513c2e..d3072c60 100644
--- a/runtime.c
+++ b/runtime.c
@@ -783,7 +783,6 @@ int CHICKEN_initialize(int heap, int stack, int symbols, void *toplevel)
C_initial_timer_interrupt_period = INITIAL_TIMER_INTERRUPT_PERIOD;
C_timer_interrupt_counter = INITIAL_TIMER_INTERRUPT_PERIOD;
memset(signal_mapping_table, 0, sizeof(int) * NSIG);
- initialize_symbol_table();
C_dlerror = "cannot load compiled code dynamically - this is a statically linked executable";
error_location = C_SCHEME_FALSE;
C_pre_gc_hook = NULL;
@@ -795,6 +794,7 @@ int CHICKEN_initialize(int heap, int stack, int symbols, void *toplevel)
callback_continuation_level = 0;
gc_ms = 0;
(void)C_randomize(C_fix(time(NULL)));
+ initialize_symbol_table();
if (profiling) {
#ifndef C_NONUNIX
Trap