Commit 2aebb568 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

dmloader: Fixed some pointer read/write checks (Coverity).

parent fc3b99b9
...@@ -125,29 +125,15 @@ static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject ...@@ -125,29 +125,15 @@ static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject
TRACE("(%p, %s, %d, %p, %p)\n", This, debugstr_dmguid(rguidClass), dwIndex, pDesc, pwszAlias); TRACE("(%p, %s, %d, %p, %p)\n", This, debugstr_dmguid(rguidClass), dwIndex, pDesc, pwszAlias);
/* check if we can write to whole pDesc */ if (!pDesc)
if (pDesc) { return E_POINTER;
if (IsBadReadPtr (pDesc, sizeof(DWORD))) { if (pDesc->dwSize != sizeof(DMUS_OBJECTDESC)) {
ERR(": pDesc->dwSize bad read pointer\n"); ERR(": invalid pDesc->dwSize %d\n", pDesc->dwSize);
return E_POINTER; return E_INVALIDARG;
}
if (pDesc->dwSize != sizeof(DMUS_OBJECTDESC)) {
ERR(": invalid pDesc->dwSize\n");
return E_INVALIDARG;
}
if (IsBadWritePtr (pDesc, sizeof(DMUS_OBJECTDESC))) {
ERR(": pDesc bad write pointer\n");
return E_POINTER;
}
}
/* check if wszAlias is big enough */
if (pwszAlias && IsBadWritePtr (pwszAlias, DMUS_MAX_FILENAME_SIZE)) {
ERR(": wszAlias bad write pointer\n");
return E_POINTER;
} }
DM_STRUCT_INIT(pDesc); DM_STRUCT_INIT(pDesc);
LIST_FOR_EACH (pEntry, This->pContainedObjects) { LIST_FOR_EACH (pEntry, This->pContainedObjects) {
pContainedObject = LIST_ENTRY (pEntry, WINE_CONTAINER_ENTRY, entry); pContainedObject = LIST_ENTRY (pEntry, WINE_CONTAINER_ENTRY, entry);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment