Fix unportable disregard of alignment requirements in RADIUS code.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 4c051c41d63e8462971c13956a38030de9c35c51
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2017-03-26T21:35:35Z
Releases: 10.0
Fix unportable disregard of alignment requirements in RADIUS code.

The compiler is entitled to store a char[] local variable with no
particular alignment requirement.  Our RADIUS code cavalierly took such
a local variable and cast its address to a struct type that does have
alignment requirements.  On an alignment-picky machine this would lead
to bus errors.  To fix, declare the local variable honestly, and then
cast its address to char * for use in the I/O calls.

Given the lack of field complaints, there must be very few if any
people affected; but nonetheless this is a clear portability issue,
so back-patch to all supported branches.

Noted while looking at a Coverity complaint in the same code.

Files

PathChange+/−
src/backend/libpq/auth.c modified +12 −9