VirtualBox

Ignore:
Timestamp:
Jan 11, 2019 8:00:15 PM (6 years ago)
Author:
vboxsync
Message:

3D: Parameters validation corrected, bugref:9327

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_program.c

    r73223 r76787  
    4545    GLdouble *params;
    4646
    47     if (num >= UINT32_MAX / (4 * sizeof(GLdouble)))
     47    if (num <= 0 || num >= INT32_MAX / (4 * sizeof(GLdouble)))
    4848    {
    4949        crError("crUnpackExtendProgramParameters4dvNV: parameter 'num' is out of range");
     
    7171    GLfloat *params;
    7272
    73     if (num >= UINT32_MAX / (4 * sizeof(GLfloat)))
     73    if (num <= 0 || num >= INT32_MAX / (4 * sizeof(GLfloat)))
    7474    {
    7575        crError("crUnpackExtendProgramParameters4fvNV: parameter 'num' is out of range");
     
    9595    const GLuint *programs = DATA_POINTER(12, const GLuint);
    9696
    97     if (n > UINT32_MAX / sizeof(GLuint) / 4 || !DATA_POINTER_CHECK(20 + n * sizeof(GLuint)))
     97    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint) / 4 || !DATA_POINTER_CHECK(20 + n * sizeof(GLuint)))
    9898    {
    9999        crError("crUnpackExtendAreProgramsResidentNV: %d is out of range", n);
     
    226226    const GLubyte *name = DATA_POINTER(16, GLubyte);
    227227
    228     if (len > UINT32_MAX / 4 || !DATA_POINTER_CHECK(16 + len + 8))
     228    if (len <= 0 || len >= INT32_MAX / 4 || !DATA_POINTER_CHECK(16 + len + 8))
    229229    {
    230230        crError("crUnpackExtendGetProgramNamedParameterdvNV: len %d is out of range", len);
     
    243243    const GLubyte *name = DATA_POINTER(16, GLubyte);
    244244
    245     if (len > UINT32_MAX / 4 || !DATA_POINTER_CHECK(16 + len + 8))
     245    if (len <= 0 || len >= INT32_MAX / 4 || !DATA_POINTER_CHECK(16 + len + 8))
    246246    {
    247247        crError("crUnpackExtendGetProgramNamedParameterfvNV: len %d is out of range", len);
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