From: Andy Polyakov Date: Sat, 24 Jan 2004 15:04:38 +0000 (+0000) Subject: Reserve for unaligned buffer. The problem was "pointed out" be HPUX64 X-Git-Tag: BEN_FIPS_TEST_5~7 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=326e02b260d994e5a06b35b17af8fa1b362cacd7;p=oweals%2Fopenssl.git Reserve for unaligned buffer. The problem was "pointed out" be HPUX64 gcc, which failed to compile it with "not aligned" at higher optimization levels. --- diff --git a/fips/rand/fips_rand.c b/fips/rand/fips_rand.c index 6e1fed07cc..0ddbff6b10 100644 --- a/fips/rand/fips_rand.c +++ b/fips/rand/fips_rand.c @@ -127,8 +127,8 @@ static void fips_gettime(unsigned char buf[8]) } gettimeofday(&tv,NULL); assert(sizeof(long) == 4); - *(long *)&buf[0]=tv.tv_sec; - *(long *)&buf[4]=tv.tv_usec; + memcpy (&buf[0],&tv.tv_sec,4); + memcpy (&buf[4],&tv.tv_usec,4); #ifndef GETPID_IS_MEANINGLESS /* we mix in the PID to ensure that after a fork the children don't give