VirtualBox

Ignore:
Timestamp:
Apr 10, 2019 11:20:02 AM (6 years ago)
Author:
vboxsync
Message:

GuestHost/OpenGL,HostServices/SharedOpenGL: Fixed parameter validation, bugref:9433

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py

    r71487 r78076  
    170170    print("{")
    171171
     172    # Verify that the provided buffer length is what we expect.
     173    packet_length = apiutil.PacketLength( params )
     174    print("\tif(!DATA_POINTER_CHECK(%d))" % packet_length);
     175    print("\t{");
     176    print("\t\tcrError(\"crUnpack%s: parameters out of range\");" % func_name);
     177    print("\t\treturn;");
     178    print("\t}");
     179
    172180    vector_func = apiutil.VectorFunction(func_name)
    173181    if (vector_func and len(apiutil.Parameters(vector_func)) == 1):
     
    175183    else:
    176184        MakeNormalCall( return_type, func_name, params )
    177     packet_length = apiutil.PacketLength( params )
    178185    if packet_length == 0:
    179186        print("\tINCR_DATA_PTR_NO_ARGS( );")
     
    330337            print('static void crUnpackExtend%s(void)' % func_name)
    331338            print('{')
     339
     340            # Verify that the provided buffer length is what we expect.
     341            packet_length = apiutil.PacketLength( params )
     342            print("\tif(!DATA_POINTER_CHECK(%d))" % packet_length);
     343            print("\t{");
     344            print("\t\tcrError(\"crUnpack%s: parameters out of range\");" % func_name);
     345            print("\t\treturn;");
     346            print("\t}");
     347
    332348            MakeNormalCall( return_type, func_name, params, 8 )
    333349            print('}\n')
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