VirtualBox

Changeset 101014 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 4, 2023 9:00:08 PM (16 months ago)
Author:
vboxsync
Message:

Main/src-client/ConsoleImplConfig*: Polishing. More obvious buffer limit and error checking.

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp

    r100717 r101014  
    331331        // VBoxC is located in the components subdirectory
    332332        char szPathVBoxC[RTPATH_MAX];
    333         vrc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC"));  AssertRC(vrc);
    334         strcat(szPathVBoxC, "/components/VBoxC");
     333        vrc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX);                                VRC();
     334        vrc = RTPathAppend(szPathVBoxC, RTPATH_MAX, "/components/VBoxC");                   VRC();
    335335        InsertConfigString(pMod,   "Path",  szPathVBoxC);
    336336#else
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp

    r100610 r101014  
    308308#define MAX_DEVICES     30
    309309#define H()     AssertLogRelMsgReturn(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR)
     310#define VRC()   AssertLogRelMsgReturn(RT_SUCCESS(vrc), ("vrc=%Rrc\n", vrc), vrc)
    310311
    311312    LONG lPortLUN[MAX_BIOS_LUN_COUNT];
     
    11651166        // VBoxC is located in the components subdirectory
    11661167        char szPathVBoxC[RTPATH_MAX];
    1167         vrc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC"));  AssertRC(vrc);
    1168         strcat(szPathVBoxC, "/components/VBoxC");
     1168        vrc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX);                                VRC();
     1169        vrc = RTPathAppend(szPathVBoxC, RTPATH_MAX, "/components/VBoxC");                   VRC();
    11691170        InsertConfigString(pMod,   "Path",  szPathVBoxC);
    11701171#else
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