VirtualBox

Changeset 88899 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 6, 2021 12:37:27 PM (4 years ago)
Author:
vboxsync
Message:

DevIchAc97, DevSB16: For the last time, RTStrPrintf doesn't work like that and shouldn't be used instead of RTStrCopy! bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r88880 r88899  
    18551855        return VERR_NO_MEMORY;
    18561856
    1857     if (!RTStrPrintf(pStreamCfg->szName, sizeof(pStreamCfg->szName), "%s", pCfg->szName))
    1858     {
    1859         PDMAudioStrmCfgFree(pStreamCfg);
    1860         return VERR_BUFFER_OVERFLOW;
    1861     }
     1857    AssertCompile(sizeof(pStreamCfg->szName) == sizeof(pCfg->szName));
     1858    RTStrCopy(pStreamCfg->szName, sizeof(pStreamCfg->szName), pCfg->szName);
    18621859
    18631860    LogFunc(("[LUN#%RU8] %s\n", pDrv->uLUN, pStreamCfg->szName));
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r88880 r88899  
    19901990        return VERR_NO_MEMORY;
    19911991
    1992     if (!RTStrPrintf(pStreamCfg->szName, sizeof(pStreamCfg->szName), "%s", pCfg->szName))
    1993     {
    1994         PDMAudioStrmCfgFree(pStreamCfg);
    1995         return VERR_BUFFER_OVERFLOW;
    1996     }
     1992    AssertCompile(sizeof(pStreamCfg->szName) == sizeof(pCfg->szName));
     1993    RTStrCopy(pStreamCfg->szName, sizeof(pStreamCfg->szName), pCfg->szName);
    19971994
    19981995    LogFunc(("[LUN#%RU8] %s\n", pDrv->uLUN, pStreamCfg->szName));
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