-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
Thanks again for your work!
Am 2015-02-23 um 08:41 schrieb Alistair Leslie-Hughes:
+{
- if (!This->comp_count)
This->components = heap_alloc( sizeof(struct component *) * This->comp_count+1 );
- else
This->components = heap_realloc(This->components, sizeof(struct component *) * This->comp_count+1 );
- This->components[This->comp_count] = item;
- This->comp_count++;
+}
This still has no error checks.
@@ -369,9 +397,48 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetComponentByIndex(IDirectPlay8Ad const DWORD dwComponentID, WCHAR *pwszName, DWORD *pdwNameLen, void *pvBuffer, DWORD *pdwBufferSize, DWORD *pdwDataType) { ...
- if (!pdwNameLen || !pdwBufferSize)
return E_POINTER;
In GetComponentByName you have additional checks for !pvBuffer.
What is pwszName name used for? Are you supposed to write the name of the retrieved component (with proper length checks)?
case DPNA_DATATYPE_STRING:
if(dwDataSize != ((strlenW((WCHAR*)lpvData)+1) * sizeof(WCHAR)))
return DPNERR_INVALIDPARAM;
I expect this also applies to DPNA_DATATYPE_STRING_ANSI. Please move it to a separate patch (preferably before the GetComponentByIndex changes), together with the tests for the length check.