Transfer only cbStruct size in BindCtxImpl_S(G)etOptions.

This commit is contained in:
Gerard Patel 1999-12-10 03:23:35 +00:00 committed by Alexandre Julliard
parent dd03cc19fd
commit f44c1f7e13
1 changed files with 12 additions and 4 deletions

View File

@ -302,8 +302,12 @@ HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts
if (pbindopts==NULL)
return E_POINTER;
This->bindOption2=*pbindopts;
if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
{
WARN("invalid size");
return E_INVALIDARG; /* FIXME : not verified */
}
memcpy(&This->bindOption2, pbindopts, pbindopts->cbStruct);
return S_OK;
}
@ -319,8 +323,12 @@ HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts
if (pbindopts==NULL)
return E_POINTER;
*pbindopts=This->bindOption2;
if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
{
WARN("invalid size");
return E_INVALIDARG; /* FIXME : not verified */
}
memcpy(pbindopts, &This->bindOption2, pbindopts->cbStruct);
return S_OK;
}