Thank you, Tom. You’re absolutely right―this change is not necessary. I’ve 
updated the patch accordingly.
Best regards,
Haibo

________________________________
发件人: Tom Lane <[email protected]>
发送时间: 2025年6月16日 12:46
收件人: Yan Haibo <[email protected]>
抄送: Peter Eisentraut <[email protected]>; [email protected] 
<[email protected]>
主题: Re: 回复: 回复: Fix potential overflow risks from wcscpy and sprintf

Yan Haibo <[email protected]> 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

Attachment: 0001-Mitigate-potential-overflow-risks-from-wcscpy.patch
Description: 0001-Mitigate-potential-overflow-risks-from-wcscpy.patch

Reply via email to