[PATCH 1/3] wininet/tests: Test InternetCrackUrl when given a bogus length

Jacek Caban jacek at codeweavers.com
Fri Jul 2 11:10:37 CDT 2021


Hi Tim,

On 7/1/21 7:40 PM, Tim Clem wrote:
> +  /* Windows treats dwUrlLength as a maximum - if there is a null before
> +   * that length, it stops there. */
> +  copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 1024, 1024);
> +  ret = InternetCrackUrlA("http://x.org", 13 /* includes the nul */, 0, &urlComponents);
> +  ok(ret, "InternetCrackUrlA failed with error %d\n", GetLastError());
> +  todo_wine
> +  ok(urlComponents.dwHostNameLength == 5,
> +     "Expected dwHostNameLength of 5, got %d\n", urlComponents.dwHostNameLength);


That test is fine on its own, but for the fix it would be also 
interesting to know what happens if you pass even larger value (that is, 
what if the length includes some characters after trailing null byte)?


Thanks,

Jacek




More information about the wine-devel mailing list