VirtualBox

Changeset 84160 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
May 6, 2020 11:03:25 AM (5 years ago)
Author:
vboxsync
Message:

Guest Control/VBoxService: More size_t/uint32_t build fixing, plus some additional integer overflow check paranoia. [build fix] bugref:9320

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r84154 r84160  
    10551055        pStartupInfo->psz##a_Str = RTStrAlloc(a_cb); \
    10561056        AssertPtrBreak(pStartupInfo->psz##a_Str); \
     1057        AssertBreak((uint32_t)a_cb == a_cb); \
    10571058        pStartupInfo->cb##a_Str  = (uint32_t)a_cb; \
    10581059    }
     
    11461147        pStartupInfoDup->psz##a_Str = (char *)RTStrDup(pStartupInfo->psz##a_Str); \
    11471148        AssertPtrBreak(pStartupInfoDup->psz##a_Str); \
    1148         pStartupInfoDup->cb##a_Str  = strlen(pStartupInfoDup->psz##a_Str) + 1 /* Include terminator */; \
     1149        size_t cbStr = strlen(pStartupInfoDup->psz##a_Str) + 1 /* Include terminator */; \
     1150        AssertBreak((uint32_t)cbStr == cbStr); \
     1151        pStartupInfoDup->cb##a_Str  = (uint32_t)cbStr; \
    11491152    }
    11501153            DUP_STR(User);
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