enable hash randomization by default

This commit is contained in:
Benjamin Peterson 2012-02-21 16:08:05 -05:00
parent 6ca5a4d49f
commit c9f54cf512
9 changed files with 44 additions and 65 deletions

View file

@ -256,17 +256,6 @@ _PyRandom_Init(void)
return;
_Py_HashSecret_Initialized = 1;
/*
By default, hash randomization is disabled, and only
enabled if PYTHONHASHSEED is set to non-empty or if
"-R" is provided at the command line:
*/
if (!Py_HashRandomizationFlag) {
/* Disable the randomized hash: */
memset(secret, 0, secret_size);
return;
}
/*
Hash randomization is enabled. Generate a per-process secret,
using PYTHONHASHSEED if provided.