回复: 回复: 回复: Fix potential overflow risks from wcscpy and sprintf

2025-06-16 Thread Yan Haibo
potential overflow risks from wcscpy and sprintf Yan Haibo 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

Re: 回复: 回复: Fix potential overflow risks from wcscpy and sprintf

2025-06-16 Thread Tom Lane
Yan Haibo 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

回复: 回复: Fix potential overflow risks from wcscpy and sprintf

2025-06-16 Thread Yan Haibo
Thank you. Tom. I agree that fixing the sprintf usage is not well-timed at the moment, so I’ve removed that change. Regarding the use of wcsncpy with LOCALE_NAME_MAX_LENGTH - 1, it is a precaution in case the input string is not null-terminated. Thanks again, Haibo __