[openssl-users] 1.1.1 pre1 tests failing on Solaris SPARC
    Viktor Dukhovni 
    openssl-users at dukhovni.org
       
    Tue Feb 20 13:38:32 UTC 2018
    
    
  
On Tue, Feb 20, 2018 at 01:26:02PM +0000, Salz, Rich via openssl-users wrote:
> Would making buf a union also avoid the problem?
> 
> 	union { unsigned long dummy[2]; char buf[DATA_BUF_SIZE]; } d
> and then replace 'buf' with 'd.buf' in the code?
If alignment of "buf" is the issue, then yes, a suitable union
would be an alternative to using malloc.  We could make the union:
    union {
	unsigned long long dummyl;
	ossl_uintmax_t     dummym;
	char              *dummyp;
	char buf[DATA_BUF_SIZE];
    } d;
just in case that's what it takes for the required alignment.  But,
OPENSSL_malloc() should do the job simply, without such hoop jumping.
Either way, the OP should confirm that aligning "buf" solves the
reported problem.
-- 
	Viktor.
    
    
More information about the openssl-users
mailing list