[PATCH] Improve safety of FormatMessage() calls on Windows

From: Christian Ullrich <chris(at)chrullrich(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] Improve safety of FormatMessage() calls on Windows
Date: 2016-03-29 13:13:52
Message-ID: nddv2g$tr1$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

There are some instances of calls to FormatMessage() with the
FORMAT_MESSAGE_FROM_SYSTEM flag that omit the
FORMAT_MESSAGE_IGNORE_INSERTS flag. The effect of that is that if the
requested message string contains any insertion markers, the call to
FormatMessage() will fail because none of these calls pass an argument list.

This patch adds the ...IGNORE_INSERTS flag to these calls.

The documentation for FormatMessage() does not clearly say that a NULL
argument list is not an implicit IGNORE_INSERTS flag, but Chen does at
<https://blogs.msdn.microsoft.com/oldnewthing/20071128-00/?p=24353>.

--
Christian

Attachment Content-Type Size
formatmessage-inserts.patch text/plain 2.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2016-03-29 13:22:26 Re: [PATCH v8] GSSAPI encryption support
Previous Message Anastasia Lubennikova 2016-03-29 13:05:33 Re: [PATCH] Supporting +-Infinity values by to_timestamp(float8)