Changeset fec6bf2 in mainline


Ignore:
Timestamp:
2011-10-07T17:14:26Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49a98c8
Parents:
6f05705
Message:

usbhub: Check size before touching configuration descriptor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/usbhub.c

    r6f05705 rfec6bf2  
    313313        }
    314314
    315         // TODO: Make sure that there is enough data and the cast is correct
     315        if (usb_device->descriptors.configuration_size
     316            < sizeof(usb_standard_configuration_descriptor_t)) {
     317            usb_log_error("Configuration descriptor is not big enough"
     318                " to fit standard configuration descriptor.\n");
     319            return EOVERFLOW;
     320        }
     321
     322        // TODO: Make sure that the cast is correct
    316323        usb_standard_configuration_descriptor_t *config_descriptor
    317324            = (usb_standard_configuration_descriptor_t *)
Note: See TracChangeset for help on using the changeset viewer.