mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
enable hash randomization by default
This commit is contained in:
parent
6ca5a4d49f
commit
c9f54cf512
9 changed files with 44 additions and 65 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue