pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
@ 2017-03-26 21:35  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-03-26 21:35 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c804c00d38f6a848f0d7e57a05ea5468fc5762b2

Modified Files
--------------
src/backend/libpq/auth.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
@ 2017-03-26 21:35  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-03-26 21:35 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5fe937f38b493f7c94c4ef8b0940e034afbd78a6

Modified Files
--------------
src/backend/libpq/auth.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
@ 2017-03-26 21:35  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-03-26 21:35 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/24fc43d40aad5f888f22af9a543113a168a08307

Modified Files
--------------
src/backend/libpq/auth.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
@ 2017-03-26 21:35  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-03-26 21:35 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/3455ddbfa6b7c38d55d2638d062f311343b8f053

Modified Files
--------------
src/backend/libpq/auth.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
@ 2017-03-26 21:35  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-03-26 21:35 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/55c642c92b974362ece5ddf100fa2fa90b3442c9

Modified Files
--------------
src/backend/libpq/auth.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix unportable disregard of alignment requirements in RADIUS cod
@ 2017-03-26 21:35  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-03-26 21:35 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4c051c41d63e8462971c13956a38030de9c35c51

Modified Files
--------------
src/backend/libpq/auth.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2017-03-26 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-26 21:35 pgsql: Fix unportable disregard of alignment requirements in RADIUS cod Tom Lane <tgl@sss.pgh.pa.us>
2017-03-26 21:35 pgsql: Fix unportable disregard of alignment requirements in RADIUS cod Tom Lane <tgl@sss.pgh.pa.us>
2017-03-26 21:35 pgsql: Fix unportable disregard of alignment requirements in RADIUS cod Tom Lane <tgl@sss.pgh.pa.us>
2017-03-26 21:35 pgsql: Fix unportable disregard of alignment requirements in RADIUS cod Tom Lane <tgl@sss.pgh.pa.us>
2017-03-26 21:35 pgsql: Fix unportable disregard of alignment requirements in RADIUS cod Tom Lane <tgl@sss.pgh.pa.us>
2017-03-26 21:35 pgsql: Fix unportable disregard of alignment requirements in RADIUS cod Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox