aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar william <william@25tandclement.com> 2014-04-19 14:42:48 -0700
committerLibravatarLibravatar william <william@25tandclement.com> 2014-04-19 14:42:48 -0700
commit34bcf562917a1b5af40c140aac2285f9894d3b73 (patch)
tree21c91ad6c6ecc5bb52cc27fd809c1ecc52d53556 /src
parentb549aa3ca66b3e823250a9c5bd027056e6c51c9b (diff)
downloadluaossl-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.c4
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:;
pid_t pid;
struct rusage ru;
struct utsname un;
- int (*fn)();
+ uintptr_t aslr;
} junk;
gettimeofday(&junk.tv, NULL);
junk.pid = getpid();
getrusage(RUSAGE_SELF, &junk.ru);
uname(&junk.un);
- junk.fn = &stir;
+ junk.aslr = (uintptr_t)&strcpy ^ (uintptr_t)&stir;
RAND_add(&junk, sizeof junk, 0.1);