VirtualBox

Changeset 103346 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Feb 14, 2024 2:06:13 AM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161659
Message:

DrvCloudTunnel: Switch the RTStrPrintfV calls with RTStrPrintf2V which has easier overflow handling. bugref:10539

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvCloudTunnel.cpp

    r103345 r103346  
    838838    va_list va;
    839839    va_start(va, pcszCommand);
    840     size_t cch = RTStrPrintfV(pThis->pszCommandBuffer, DRVCLOUDTUNNEL_COMMAND_BUFFER_SIZE, pcszCommand, va);
     840    ssize_t const cch = RTStrPrintf2V(pThis->pszCommandBuffer, DRVCLOUDTUNNEL_COMMAND_BUFFER_SIZE, pcszCommand, va);
    841841    va_end(va);
    842     if (cch == 0)  /** @todo r=bird: WTF is this supposed to be? Checking for empty pcszCommand? */
     842    if (cch <= 0)
    843843    {
    844844        Log(("%s: Failed to process '%s'\n", pThis->pszInstance, pcszCommand));
     
    880880    va_list va;
    881881    va_start(va, pcszCommand);
    882     size_t cch = RTStrPrintfV(pThis->pszCommandBuffer, DRVCLOUDTUNNEL_COMMAND_BUFFER_SIZE, pcszCommand, va);
     882    ssize_t const cch = RTStrPrintf2V(pThis->pszCommandBuffer, DRVCLOUDTUNNEL_COMMAND_BUFFER_SIZE, pcszCommand, va);
    883883    va_end(va);
    884     if (cch == 0) /** @todo r=bird: WTF is this supposed to be? Checking for empty pcszCommand? */
     884    if (cch <= 0)
    885885    {
    886886        Log(("%s: Failed to process '%s'\n", pThis->pszInstance, pcszCommand));
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