Fix overflow at return wchar2char (src/backend/utils/adt/pg_locale.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fix overflow at return wchar2char (src/backend/utils/adt/pg_locale.c)
Date: 2020-09-14 12:41:36
Message-ID: CAEudQAq5JFG88GCdgTkwrxRKT+T6RFjtXx8jberaOfAUzNOwdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

1. wchar2char has a mistake when checking the return of WideCharToMultiByte
call.
result variable is unsigned, therefore, cannot be less than zero, returning
-1 is not an option.

2. strftime or strftime_win32, return cannot be less than zero.

3. If strftime or strftime_win32, fails, why not abort the loop?

regards,
Ranier Vilela

Attachment Content-Type Size
v1-0001-fix_overflow_wchar2char.patch application/octet-stream 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-09-14 13:45:17 Re: problem with RETURNING and update row movement
Previous Message Stephen Frost 2020-09-14 12:39:42 Re: TDE (Transparent Data Encryption) supported ?