Hm, I see your point, and the third patch in this set actually fixes the behavior of both CrackURLA and W, since the first calls the second. But, heap_strndupAtoW is definitely not doing what it's supposed to do in this case - all other strndups, including heap_strndupW in the same header, tread the length as a maximum and stop at the first null. I worry that leaving this as-is is asking for trouble.
July 2, 2021 9:13 AM, "Jacek Caban" jacek@codeweavers.com wrote:
Hi Tim,
On 7/1/21 7:40 PM, Tim Clem wrote:
@@ -152,7 +152,10 @@ static inline WCHAR *heap_strndupAtoW(const char *str, int len_a, DWORD *len_w)
if(str) {
size_t len;
- if(len_a < 0) len_a = strlen(str);
- if(len_a < 0)
- len_a = strlen(str);
- else if(len_a > 0)
- len_a = strnlen(str, len_a);
The problem seems specific to InternetCrackUrlA, I'm not sure if we should change general helper.
Thanks,
Jacek