Re: 回复: 回复: Fix potential overflow risks from wcscpy and sprintf - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 回复: 回复: Fix potential overflow risks from wcscpy and sprintf
Date
Msg-id 658992.1750103214@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fix potential overflow risks from wcscpy and sprintf  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
Yan Haibo <haibo.yan@hotmail.com> writes:
> Regarding the use of wcsncpy with LOCALE_NAME_MAX_LENGTH - 1, it is a precaution in case the input string is not
null-terminated.

I don't think it's a "precaution".  I think it's introducing a real
bug (that is, failure on a locale name of exactly the max allowed
length) to prevent a hypothetical bug.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: No error checking when reading from file using zstd in pg_dump
Next
From: Tomas Vondra
Date:
Subject: Re: Amcheck verification of GiST and GIN