VirtualBox

Changeset 76793 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Jan 13, 2019 8:53:58 PM (6 years ago)
Author:
vboxsync
Message:

3D: Validation of glDeleteQueries arguments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_occlude.c

    r69392 r76793  
    1111#include "cr_mem.h"
    1212
     13#if !defined(IN_GUEST)
     14#include "cr_unpack.h"
     15#endif
    1316
    1417void
     
    6164        }
    6265
    63         if (n < 0) {
    64                 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE,
    65                                                                  "glDeleteQueriesARB(n < 0)");
    66                 return;
    67         }
    68 
    69         for (i = 0; i < n; i++) {
     66    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
     67    {
     68        crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     69                     "glDeleteQueriesARB: parameter 'n' is out of range");
     70        return;
     71    }
     72
     73#if !defined(IN_GUEST)
     74    if (!DATA_POINTER_CHECK(n * sizeof(GLuint)))
     75    {
     76        crError("glDeleteQueriesARB: parameter 'n' is out of range");
     77        return;
     78    }
     79#endif
     80
     81    for (i = 0; i < n; i++) {
    7082                if (ids[i]) {
    7183                        CROcclusionObject *q = (CROcclusionObject *)
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