vbscript: Fix a memory allocation size to avoid overflows.
This commit is contained in:
parent
a7df4958ab
commit
9fe25eae4a
|
@ -398,7 +398,7 @@ HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
|
|||
{
|
||||
vbdisp_t *vbdisp;
|
||||
|
||||
vbdisp = heap_alloc_zero(sizeof(*vbdisp) + (desc->prop_cnt-1)*sizeof(VARIANT));
|
||||
vbdisp = heap_alloc_zero( FIELD_OFFSET( vbdisp_t, props[desc->prop_cnt] ));
|
||||
if(!vbdisp)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
|
|
Loading…
Reference in New Issue