VirtualBox

Changeset 76793 in vbox for trunk/src/VBox


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

3D: Validation of glDeleteQueries arguments

Location:
trunk/src/VBox
Files:
3 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 *)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_bufferobject.c

    r76787 r76793  
    1010#include "server_dispatch.h"
    1111#include "server.h"
     12#include "cr_unpack.h"
    1213
    1314void * SERVER_DISPATCH_APIENTRY
     
    5152void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteBuffersARB( GLsizei n, const GLuint * buffer )
    5253{
     54    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint) || !DATA_POINTER_CHECK(n * sizeof(GLuint)))
     55    {
     56        crError("glDeleteBuffersARB: parameter 'n' is out of range");
     57        return;
     58    }
     59
    5360    crStateDeleteBuffersARB( n, buffer );
    5461}
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c

    r76787 r76793  
    2222#include "server_dispatch.h"
    2323#include "server.h"
     24#include "cr_unpack.h"
    2425
    2526void SERVER_DISPATCH_APIENTRY
     
    181182void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
    182183{
    183         crStateDeleteFramebuffersEXT(n, framebuffers);
     184    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint) || !DATA_POINTER_CHECK(n * sizeof(GLuint)))
     185    {
     186        crError("crStateDeleteFramebuffersEXT: parameter 'n' is out of range");
     187        return;
     188    }
     189
     190    crStateDeleteFramebuffersEXT(n, framebuffers);
    184191}
    185192
    186193void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
    187194{
    188         crStateDeleteRenderbuffersEXT(n, renderbuffers);
     195    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint) || !DATA_POINTER_CHECK(n * sizeof(GLuint)))
     196    {
     197        crError("glDeleteRenderbuffersEXT: parameter 'n' is out of range");
     198        return;
     199    }
     200
     201    crStateDeleteRenderbuffersEXT(n, renderbuffers);
    189202}
    190203
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