Ignore:
Timestamp:
Sep 14, 2000, 4:57:01 PM (25 years ago)
Author:
davidr
Message:

BugFixes & Updates (CorelWine)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/bindctx.cpp

    r3497 r4258  
    1 /* $Id: bindctx.cpp,v 1.3 2000-05-05 18:21:36 sandervl Exp $ */
     1/* $Id: bindctx.cpp,v 1.4 2000-09-14 14:57:00 davidr Exp $ */
    22/*
    33 * BindCtx implementation
     
    300300HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts)
    301301{
     302    DWORD size = sizeof(BIND_OPTS2);
     303
    302304    ICOM_THIS(BindCtxImpl,iface);
    303305
     
    306308    if (pbindopts==NULL)
    307309        return E_POINTER;
    308    
    309     if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
    310     {
    311         WARN("invalid size");
    312         return E_INVALIDARG; /* FIXME : not verified */
    313     }
    314     memcpy(&This->bindOption2, pbindopts, pbindopts->cbStruct);
     310
     311    /* make sure we don't copy more bytes than we can */
     312    if (pbindopts->cbStruct < size)
     313        size = pbindopts->cbStruct;
     314   
     315    memcpy(&This->bindOption2, pbindopts, size);
    315316
    316317    return S_OK;
     
    322323HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts)
    323324{
     325    DWORD size = sizeof(BIND_OPTS2);
     326
    324327    ICOM_THIS(BindCtxImpl,iface);
    325328
     
    329332        return E_POINTER;
    330333
    331     if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
    332     {
    333         WARN("invalid size");
    334         return E_INVALIDARG; /* FIXME : not verified */
    335     }
    336     memcpy(pbindopts, &This->bindOption2, pbindopts->cbStruct);
     334    /* make sure we don't copy more bytes than we can */
     335    if (pbindopts->cbStruct < size)
     336        size = pbindopts->cbStruct;
     337
     338    memcpy(pbindopts, &This->bindOption2, size);
    337339   
    338340    return S_OK;
Note: See TracChangeset for help on using the changeset viewer.