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/crserverlib/server_gentextures.c

    r74890 r76787  
    1717    (void) textures;
    1818
    19     if (n >= INT32_MAX / sizeof(GLuint))
     19    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
    2020    {
    2121        crError("crServerDispatchGenTextures: parameter 'n' is out of range");
     
    4242    (void) ids;
    4343
    44     if (n >= INT32_MAX / sizeof(GLuint))
     44    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
    4545    {
    4646        crError("crServerDispatchGenProgramsNV: parameter 'n' is out of range");
     
    6767    (void) ids;
    6868
    69     if (n >= INT32_MAX / sizeof(GLuint))
     69    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
    7070    {
    7171        crError("crServerDispatchGenFencesNV: parameter 'n' is out of range");
     
    8888void SERVER_DISPATCH_APIENTRY crServerDispatchGenProgramsARB( GLsizei n, GLuint * ids )
    8989{
    90     GLuint *local_progs = (GLuint *) crAlloc( n*sizeof( *local_progs) );
     90    GLuint *local_progs;
    9191    GLsizei i;
    9292    (void) ids;
    9393
    94     if (n >= INT32_MAX / sizeof(GLuint))
     94    if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
    9595    {
    9696        crError("crServerDispatchGenProgramsARB: parameter 'n' is out of range");
     
    102102    if (!local_progs)
    103103    {
    104         crError("crServerDispatchGenProgramsARB: out of memory");
     104        crError("crServerDispatchGenProgramsARB: out of money");
    105105        return;
    106106    }
     
    120120    }
    121121
    122     crServerReturnValue( local_progs, n*sizeof( *local_progs ) );
     122    crServerReturnValue( local_progs, n * sizeof( *local_progs ) );
    123123    crFree( local_progs );
    124124}
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