diff options
author | william <william@25tandclement.com> | 2014-04-19 14:42:48 -0700 |
---|---|---|
committer | william <william@25tandclement.com> | 2014-04-19 14:42:48 -0700 |
commit | 34bcf562917a1b5af40c140aac2285f9894d3b73 (patch) | |
tree | 21c91ad6c6ecc5bb52cc27fd809c1ecc52d53556 /src | |
parent | b549aa3ca66b3e823250a9c5bd027056e6c51c9b (diff) | |
download | luaossl-34bcf562917a1b5af40c140aac2285f9894d3b73.tar.gz luaossl-34bcf562917a1b5af40c140aac2285f9894d3b73.tar.bz2 luaossl-34bcf562917a1b5af40c140aac2285f9894d3b73.zip |
ASLR behaves differently on different platforms; try to maximize our chances of benefiting from it
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openssl.c b/src/openssl.c index 4a21c69..624f6d5 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -4063,14 +4063,14 @@ error:; | |||
4063 | pid_t pid; | 4063 | pid_t pid; |
4064 | struct rusage ru; | 4064 | struct rusage ru; |
4065 | struct utsname un; | 4065 | struct utsname un; |
4066 | int (*fn)(); | 4066 | uintptr_t aslr; |
4067 | } junk; | 4067 | } junk; |
4068 | 4068 | ||
4069 | gettimeofday(&junk.tv, NULL); | 4069 | gettimeofday(&junk.tv, NULL); |
4070 | junk.pid = getpid(); | 4070 | junk.pid = getpid(); |
4071 | getrusage(RUSAGE_SELF, &junk.ru); | 4071 | getrusage(RUSAGE_SELF, &junk.ru); |
4072 | uname(&junk.un); | 4072 | uname(&junk.un); |
4073 | junk.fn = &stir; | 4073 | junk.aslr = (uintptr_t)&strcpy ^ (uintptr_t)&stir; |
4074 | 4074 | ||
4075 | RAND_add(&junk, sizeof junk, 0.1); | 4075 | RAND_add(&junk, sizeof junk, 0.1); |
4076 | 4076 | ||