[PATCH 1/3] ole32: Fix sizeof mismatch in CompositeMonikerImpl_Construct.

Marcus Meissner marcus at jet.franken.de
Wed Mar 30 02:46:44 CDT 2016


On Tue, Mar 29, 2016 at 06:31:15PM -0600, Alex Henrie wrote:
> Cc: Marcus Meissner <marcus at jet.franken.de>
> 
> Coverity #713908, "Passing argument This->tabSize * 4U /* sizeof
> (IMoniker) */ to function HeapReAlloc and then casting the return value
> to IMoniker ** is suspicious."
> 
> All of the other sizeof mistakes in this function were fixed by commit
> 826bff384d572ada9cc83674547a1aebe0e4f953.
> 
> Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>

Looks good.

Signed-off-by: Marcus Meissner <marcus at jet.franken.de>

Ciao, Marcus

> ---
>  dlls/ole32/compositemoniker.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c
> index e431bfc..e1e0e5c 100644
> --- a/dlls/ole32/compositemoniker.c
> +++ b/dlls/ole32/compositemoniker.c
> @@ -1803,7 +1803,7 @@ CompositeMonikerImpl_Construct(IMoniker **ppMoniker, IMoniker *pmkFirst, IMonike
>                  LPVOID tab_moniker = This->tabMoniker;
>  
>                  This->tabSize+=BLOCK_TAB_SIZE;
> -                This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker));
> +                This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(This->tabMoniker[0]));
>  
>                  if (This->tabMoniker==NULL){
>                      HeapFree(GetProcessHeap(), 0, tab_moniker);
> -- 
> 2.7.4
> 
> 



More information about the wine-patches mailing list