pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function.
@ 2016-03-29 15:56  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-03-29 15:56 UTC (permalink / raw)
  To: pgsql-committers

Avoid possibly-unsafe use of Windows' FormatMessage() function.

Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
Otherwise, if the message contains any %n insertion markers, the function
will try to fetch argument strings to substitute --- which we are not
passing, possibly leading to a crash.  This is exactly analogous to the
rule about not giving printf() a format string you're not in control of.

Noted and patched by Christian Ullrich.
Back-patch to all supported branches.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6cd30292bfc38edcae0c1d9c127265cfe665a569

Modified Files
--------------
src/backend/libpq/auth.c        | 4 +++-
src/backend/port/win32/socket.c | 4 +++-
src/interfaces/libpq/fe-auth.c  | 4 +++-
src/port/dirmod.c               | 8 ++++++--
4 files changed, 15 insertions(+), 5 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: Avoid possibly-unsafe use of Windows' FormatMessage() function.
@ 2016-03-29 15:56  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-03-29 15:56 UTC (permalink / raw)
  To: pgsql-committers

Avoid possibly-unsafe use of Windows' FormatMessage() function.

Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
Otherwise, if the message contains any %n insertion markers, the function
will try to fetch argument strings to substitute --- which we are not
passing, possibly leading to a crash.  This is exactly analogous to the
rule about not giving printf() a format string you're not in control of.

Noted and patched by Christian Ullrich.
Back-patch to all supported branches.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/11cc7bb8825efc74c9418f6e88d448cc253c47b0

Modified Files
--------------
src/backend/libpq/auth.c        | 4 +++-
src/backend/port/win32/socket.c | 4 +++-
src/interfaces/libpq/fe-auth.c  | 4 +++-
src/port/dirmod.c               | 8 ++++++--
4 files changed, 15 insertions(+), 5 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: Avoid possibly-unsafe use of Windows' FormatMessage() function.
@ 2016-03-29 15:56  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-03-29 15:56 UTC (permalink / raw)
  To: pgsql-committers

Avoid possibly-unsafe use of Windows' FormatMessage() function.

Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
Otherwise, if the message contains any %n insertion markers, the function
will try to fetch argument strings to substitute --- which we are not
passing, possibly leading to a crash.  This is exactly analogous to the
rule about not giving printf() a format string you're not in control of.

Noted and patched by Christian Ullrich.
Back-patch to all supported branches.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7abc1571652a924ba4258bda0a26df2de03b790e

Modified Files
--------------
src/backend/libpq/auth.c        | 4 +++-
src/backend/port/win32/socket.c | 4 +++-
src/interfaces/libpq/fe-auth.c  | 4 +++-
src/port/dirmod.c               | 8 ++++++--
4 files changed, 15 insertions(+), 5 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: Avoid possibly-unsafe use of Windows' FormatMessage() function.
@ 2016-03-29 15:56  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-03-29 15:56 UTC (permalink / raw)
  To: pgsql-committers

Avoid possibly-unsafe use of Windows' FormatMessage() function.

Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
Otherwise, if the message contains any %n insertion markers, the function
will try to fetch argument strings to substitute --- which we are not
passing, possibly leading to a crash.  This is exactly analogous to the
rule about not giving printf() a format string you're not in control of.

Noted and patched by Christian Ullrich.
Back-patch to all supported branches.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2fed676c937cdcdfafa72865308b84a7f273e730

Modified Files
--------------
src/backend/libpq/auth.c        | 4 +++-
src/backend/port/win32/socket.c | 4 +++-
src/interfaces/libpq/fe-auth.c  | 4 +++-
src/port/dirmod.c               | 8 ++++++--
4 files changed, 15 insertions(+), 5 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: Avoid possibly-unsafe use of Windows' FormatMessage() function.
@ 2016-03-29 15:56  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-03-29 15:56 UTC (permalink / raw)
  To: pgsql-committers

Avoid possibly-unsafe use of Windows' FormatMessage() function.

Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
Otherwise, if the message contains any %n insertion markers, the function
will try to fetch argument strings to substitute --- which we are not
passing, possibly leading to a crash.  This is exactly analogous to the
rule about not giving printf() a format string you're not in control of.

Noted and patched by Christian Ullrich.
Back-patch to all supported branches.

Branch
------
REL9_2_STABLE

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

Modified Files
--------------
src/backend/libpq/auth.c        | 4 +++-
src/backend/port/win32/socket.c | 4 +++-
src/interfaces/libpq/fe-auth.c  | 4 +++-
src/port/dirmod.c               | 8 ++++++--
4 files changed, 15 insertions(+), 5 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: Avoid possibly-unsafe use of Windows' FormatMessage() function.
@ 2016-03-29 15:56  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-03-29 15:56 UTC (permalink / raw)
  To: pgsql-committers

Avoid possibly-unsafe use of Windows' FormatMessage() function.

Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
Otherwise, if the message contains any %n insertion markers, the function
will try to fetch argument strings to substitute --- which we are not
passing, possibly leading to a crash.  This is exactly analogous to the
rule about not giving printf() a format string you're not in control of.

Noted and patched by Christian Ullrich.
Back-patch to all supported branches.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/491e847380740dac54d4ecae820261bbaa8aee44

Modified Files
--------------
src/backend/libpq/auth.c        | 4 +++-
src/backend/port/win32/socket.c | 4 +++-
src/interfaces/libpq/fe-auth.c  | 4 +++-
src/port/dirmod.c               | 8 ++++++--
4 files changed, 15 insertions(+), 5 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:[~2016-03-29 15:56 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29 15:56 pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function. Tom Lane <tgl@sss.pgh.pa.us>
2016-03-29 15:56 pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function. Tom Lane <tgl@sss.pgh.pa.us>
2016-03-29 15:56 pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function. Tom Lane <tgl@sss.pgh.pa.us>
2016-03-29 15:56 pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function. Tom Lane <tgl@sss.pgh.pa.us>
2016-03-29 15:56 pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function. Tom Lane <tgl@sss.pgh.pa.us>
2016-03-29 15:56 pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function. 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