VirtualBox

Changeset 68307 in vbox for trunk


Ignore:
Timestamp:
Aug 6, 2017 7:04:02 PM (7 years ago)
Author:
vboxsync
Message:

Additions/Solaris/Mouse: try to fix message freeing.

bugref:8953: Solaris Additions/pointer driver: BUG 26414285: DOUBLE-FREE FROM VBOX CODE
Hopefully remove the freemsg() call which was responsible for a double free
reported by the Solaris team, and try to fix some other potential memory
issues as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/solaris/Mouse/vboxms.c

    r62529 r68307  
    655655
    656656            /* We have no one below us to pass the message on to. */
     657            freemsg(pMBlk);
    657658            return 0;
    658659        /* M_IOCDATA is additional data attached to (at least) transparent
     
    11961197                 (void *)pCopyResp->cp_private));
    11971198    if (pCopyResp->cp_rval)  /* cp_rval is a pointer used as a boolean. */
    1198     {
    1199         freemsg(pMBlk);
    12001199        return EAGAIN;
    1201     }
    12021200    if ((pCopyResp->cp_private && enmDirection == BOTH) || enmDirection == IN)
    12031201    {
     
    12071205
    12081206        if (!pMBlk->b_cont)
    1209             return EINVAL;
    1210         if (enmDirection == BOTH && !pCopyResp->cp_private)
    12111207            return EINVAL;
    12121208        pvData = pMBlk->b_cont->b_rptr;
     
    12161212        else if (!err && enmDirection == IN)
    12171213            vbmsSolAcknowledgeIOCtl(pMBlk, 0, 0);
     1214        if ((err || enmDirection == IN) && pCopyResp->cp_private)
     1215            freemsg(pCopyResp->cp_private);
    12181216        return err;
    12191217    }
    12201218    else
    12211219    {
     1220        if (pCopyResp->cp_private)
     1221            freemsg(pCopyResp->cp_private);
    12221222        AssertReturn(enmDirection == OUT || enmDirection == BOTH, EINVAL);
    12231223        vbmsSolAcknowledgeIOCtl(pMBlk, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette