Re: [1/3] dpnet: Add check for mismatched string lengths (try 2)
3 Mar
2015
3 Mar
'15
9:13 a.m.
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.
4027
Age (days ago)
4027
Last active (days ago)
0 comments
1 participants
participants (1)
-
Nikolay Sivov