VirtualBox

Changeset 40436 in vbox for trunk


Ignore:
Timestamp:
Mar 12, 2012 6:28:21 PM (13 years ago)
Author:
vboxsync
Message:

VbglR3CredentialsDestroyUtf16: RTUtf16Len returns the length as a count of RTUTF16 items, so multiply by sizeof(RTUTF16) to get the length.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp

    r40263 r40436  
    146146        }
    147147        else
    148             VbglR3CredentialsDestroyUtf16(pwszUser, pwszPassword, pwszDomain,
    149                                           3 /* Passes */);
    150 
    151         VbglR3CredentialsDestroy(pszUser, pszPassword, pszDomain,
    152                                  3 /* Passes */);
     148            VbglR3CredentialsDestroyUtf16(pwszUser, pwszPassword, pwszDomain, 3 /* Passes */);
     149        VbglR3CredentialsDestroy(pszUser, pszPassword, pszDomain, 3 /* Passes */);
    153150    }
    154151
    155152    return rc;
    156153}
     154
    157155
    158156/**
     
    183181}
    184182
     183
    185184/**
    186185 * Clears and frees the three strings. UTF-16 version.
     
    199198    /* wipe first */
    200199    if (pwszUser)
    201         RTMemWipeThoroughly(pwszUser,     RTUtf16Len(pwszUser) + sizeof(RTUTF16),    cPasses);
     200        RTMemWipeThoroughly(pwszUser,     (RTUtf16Len(pwszUser)     + 1) * sizeof(RTUTF16), cPasses);
    202201    if (pwszPassword)
    203         RTMemWipeThoroughly(pwszPassword, RTUtf16Len(pwszPassword) + sizeof(RTUTF16), cPasses);
     202        RTMemWipeThoroughly(pwszPassword, (RTUtf16Len(pwszPassword) + 1) * sizeof(RTUTF16), cPasses);
    204203    if (pwszDomain)
    205         RTMemWipeThoroughly(pwszDomain,   RTUtf16Len(pwszDomain) + sizeof(RTUTF16),  cPasses);
     204        RTMemWipeThoroughly(pwszDomain,   (RTUtf16Len(pwszDomain)   + 1) * sizeof(RTUTF16), cPasses);
    206205
    207206    /* then free. */
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