[1/3] dpnet: Add check for mismatched string lengths (try 2)
Nikolay Sivov
bunglehead at gmail.com
Tue Mar 3 03:13:20 CST 2015
On 03.03.2015 11:57, Alistair Leslie-Hughes wrote:
> + hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_HOSTNAME, &localhost, sizeof(localhost)+2, DPNA_DATATYPE_STRING);
> + ok(hr == DPNERR_INVALIDPARAM, "got 0x%08x\n", hr);
What happens with size == sizeof(localhost)/2 (or any size that cuts off
a string)? Does it make a partial copy?
> + hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_HOSTNAME, "testing", 8+2, DPNA_DATATYPE_STRING_ANSI);
> + ok(hr == DPNERR_INVALIDPARAM, "got 0x%08x\n", hr);
Please use sizeof() here too.
More information about the wine-devel
mailing list