VirtualBox

Changeset 32878 in vbox for trunk


Ignore:
Timestamp:
Oct 3, 2010 8:30:49 PM (14 years ago)
Author:
vboxsync
Message:

strncat fixes

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r32688 r32878  
    290290    pPreHdr->u32Version = VDI_IMAGE_VERSION;
    291291    memset(pPreHdr->szFileInfo, 0, sizeof(pPreHdr->szFileInfo));
    292     strncat(pPreHdr->szFileInfo, VDI_IMAGE_FILE_INFO, sizeof(pPreHdr->szFileInfo));
     292    strncat(pPreHdr->szFileInfo, VDI_IMAGE_FILE_INFO, sizeof(pPreHdr->szFileInfo)-1);
    293293}
    294294
     
    361361        AssertMsg(strlen(pszComment) < sizeof(pHeader->u.v1.szComment),
    362362                  ("HDD Comment is too long, cb=%d\n", strlen(pszComment)));
    363         strncat(pHeader->u.v1.szComment, pszComment, sizeof(pHeader->u.v1.szComment));
     363        strncat(pHeader->u.v1.szComment, pszComment, sizeof(pHeader->u.v1.szComment)-1);
    364364    }
    365365
  • trunk/src/VBox/Runtime/testcase/tstLdr-3.cpp

    r28800 r32878  
    139139        pSym->aSyms[0].szName[0] = '\0';
    140140        if (pszSymbol)
    141             strncat(pSym->aSyms[0].szName, pszSymbol, sizeof(pSym->aSyms[0].szName));
     141            strncat(pSym->aSyms[0].szName, pszSymbol, sizeof(pSym->aSyms[0].szName)-1);
    142142    }
    143143
     
    157157        pSym->aSyms[1].szName[0] = '\0';
    158158        if (pszSymbol)
    159             strncat(pSym->aSyms[1].szName, pszSymbol, sizeof(pSym->aSyms[1].szName));
     159            strncat(pSym->aSyms[1].szName, pszSymbol, sizeof(pSym->aSyms[1].szName)-1);
    160160    }
    161161
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