VirtualBox

Ignore:
Timestamp:
Jun 26, 2019 8:38:38 AM (6 years ago)
Author:
vboxsync
Message:

SharedOpenGL: replaced DATA_POINTER_CHECK with DATA_POINTER_CHECK_SIZE. bugref:9435

Location:
trunk/src/VBox/HostServices/SharedOpenGL/unpacker
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_map.cpp

    r78190 r79340  
    3737
    3838    cbMax = (ustride * uorder + vstride * vorder) * sizeof(double);
    39     if (!DATA_POINTER_CHECK(pState, cbMax))
     39    if (!DATA_POINTER_CHECK_SIZE(pState, cbMax))
    4040    {
    4141        crError("crUnpackMap2d: parameters out of range");
     
    7474
    7575    cbMax = (ustride * uorder + vstride * vorder) * sizeof(float);
    76     if (!DATA_POINTER_CHECK(pState, cbMax))
     76    if (!DATA_POINTER_CHECK_SIZE(pState, cbMax))
    7777    {
    7878        crError("crUnpackMap2f: parameters out of range");
     
    105105
    106106    cbMax = stride * order * sizeof(double);
    107     if (!DATA_POINTER_CHECK(pState, cbMax))
     107    if (!DATA_POINTER_CHECK_SIZE(pState, cbMax))
    108108    {
    109109        crError("crUnpackMap1d: parameters out of range");
     
    136136
    137137    cbMax = stride * order * sizeof(float);
    138     if (!DATA_POINTER_CHECK(pState, cbMax))
     138    if (!DATA_POINTER_CHECK_SIZE(pState, cbMax))
    139139    {
    140140        crError("crUnpackMap1f: parameters out of range");
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_misc.cpp

    r78375 r79340  
    5454    const GLuint *ids = DATA_POINTER(pState, 12, GLuint);
    5555
    56     if (n < 0 || n >= INT32_MAX / sizeof(GLint) / 4 || !DATA_POINTER_CHECK(pState, 12 + n * sizeof(GLuint)))
     56    if (n < 0 || n >= (INT32_MAX / 8) / sizeof(GLint) || !DATA_POINTER_CHECK_SIZE(pState, 12 + n * sizeof(GLuint)))
    5757    {
    5858        crError("crUnpackExtendDeleteQueriesARB: parameter 'n' is out of range");
     
    136136    GLint *pRects = (GLint *)DATA_POINTER(pState, 28, GLvoid );
    137137
    138     if (cRects <= 0 || cRects >= INT32_MAX / sizeof(GLint) / 8 || !DATA_POINTER_CHECK(pState, 28 + 4 * cRects * sizeof(GLint)))
     138    if (cRects <= 0 || cRects >= (INT32_MAX / 8) / (4 * sizeof(GLint)) || !DATA_POINTER_CHECK_SIZE(pState, 28 + cRects * 4 * sizeof(GLint)))
    139139    {
    140         crError("crUnpackExtendVBoxTexPresent: parameter 'cRects' is out of range");
     140        crError("crUnpackExtendVBoxTexPresent: parameter 'cRects' %d is out of range", cRects);
    141141        return;
    142142    }
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_program.cpp

    r78263 r79340  
    9292    const GLuint *programs = DATA_POINTER(pState, 12, const GLuint);
    9393
    94     if (n <= 0 || n >= INT32_MAX / sizeof(GLuint) / 4 || !DATA_POINTER_CHECK(pState, 20 + n * sizeof(GLuint)))
     94    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint) / 4 || !DATA_POINTER_CHECK_SIZE(pState, 20 + n * sizeof(GLuint)))
    9595    {
    9696        crError("crUnpackExtendAreProgramsResidentNV: %d is out of range", n);
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.cpp

    r78265 r79340  
    5858    pos = 20 + count * sizeof(*pLocalLength);
    5959
    60     if (!DATA_POINTER_CHECK(pState, pos))
     60    if (!DATA_POINTER_CHECK_SIZE(pState, pos))
    6161    {
    6262        crError("crUnpackExtendShaderSource: pos %d is out of range", pos);
     
    7272    pos_check = pos;
    7373
    74     if (!DATA_POINTER_CHECK(pState, pos_check))
     74    if (!DATA_POINTER_CHECK_SIZE(pState, pos_check))
    7575    {
    7676        crError("crUnpackExtendShaderSource: pos %d is out of range", pos);
     
    8282    for (i = 0; i < count; ++i)
    8383    {
    84         if (pLocalLength[i] <= 0 || pos_check >= INT32_MAX - pLocalLength[i] || !DATA_POINTER_CHECK(pState, pos_check))
     84        if (pLocalLength[i] <= 0 || pos_check >= INT32_MAX - pLocalLength[i] || !DATA_POINTER_CHECK_SIZE(pState, pos_check))
    8585        {
    8686            crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check);
     
    9090        pos_check += pLocalLength[i];
    9191
    92         if (!DATA_POINTER_CHECK(pState, pos_check))
     92        if (!DATA_POINTER_CHECK_SIZE(pState, pos_check))
    9393        {
    9494            crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check);
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