VirtualBox

Changeset 52201 in vbox


Ignore:
Timestamp:
Jul 25, 2014 8:15:15 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95261
Message:

Additions/common/VBoxGuestLib: missing return check when retrieving a video mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r52189 r52201  
    434434 * Now we convert the string returned to numeric values.
    435435 */
    436     cMatches = sscanf(szModeParms, "%ux%ux%u,%ux%u,%u\n", &cx, &cy, &cBits, &x,
    437                       &y, &fEnabled);
    438     if (cMatches == 6)
    439         rc = VINF_SUCCESS;
    440     else if (cMatches < 0)
    441         rc = VERR_READ_ERROR;
    442     else
    443         rc = VERR_PARSE_ERROR;
     436    if (RT_SUCCESS(rc))
     437    {
     438        cMatches = sscanf(szModeParms, "%ux%ux%u,%ux%u,%u\n", &cx, &cy, &cBits,
     439                          &x, &y, &fEnabled);
     440        if (cMatches == 6)
     441            rc = VINF_SUCCESS;
     442        else if (cMatches < 0)
     443            rc = VERR_READ_ERROR;
     444        else
     445            rc = VERR_PARSE_ERROR;
     446    }
    444447/*
    445448 * And clean up and return the values if we successfully obtained them.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette