dpnet: Fix short buffer check also for the A case.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-08-26 12:46:18 +02:00
parent 53bd74489d
commit b95cc68894
2 changed files with 2 additions and 4 deletions

View file

@ -326,10 +326,7 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetURLA(IDirectPlay8Address *iface
return DPNERR_INVALIDPOINTER;
if(url && *length)
{
url[0] = '\0';
buffer = heap_alloc(*length * sizeof(WCHAR));
}
hr = IDirectPlay8Address_GetURLW(iface, buffer, length);
if(hr == DPN_OK)

View file

@ -400,9 +400,10 @@ static void address_urlA(void)
ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
bufflen2 = bufflen/2;
memset( buffer, 0x55, sizeof(buffer) );
hr = IDirectPlay8Address_GetURLA(localaddr, buffer, &bufflen2);
ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
ok(!strlen(buffer), "wrong length\n");
ok(buffer[0] == 0x55, "buffer modified\n");
hr = IDirectPlay8Address_GetURLA(localaddr, buffer, &bufflen);
ok(hr == S_OK, "got 0x%08x\n", hr);