VirtualBox

Changeset 103292 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 9, 2024 1:29:46 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161586
Message:

Runtime/testcase/tstRTProcCreateEx: Fix a potential buffer overrun error if the child should get executed with the wrong argument count from the testcase (which doesn't happen), bugref:3409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp

    r99486 r103292  
    580580
    581581    int cErrors = 0;
    582     for (int i = 0; i < argc; i++)
     582    if (argc >= (int)RT_ELEMENTS(g_apszArgs4))
     583    {
     584        RTStrmPrintf(g_pStdErr,
     585                     "Expected argument count to be <= %u, got %u\n",
     586                     argc, RT_ELEMENTS(g_apszArgs4));
     587        cErrors++;
     588    }
     589
     590    for (int i = 0; i < RT_MIN(argc, (int)RT_ELEMENTS(g_apszArgs4) - 1); i++)
    583591        if (strcmp(argv[i], g_apszArgs4[i]))
    584592        {
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