Changeset 8bec4d1 in mainline


Ignore:
Timestamp:
2011-03-08T19:25:20Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
021351c, 60a228f
Parents:
3de529c
Message:

possible buffer overflow check fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hidparser.c

    r3de529c r8bec4d1  
    119119        }
    120120        link_initialize(&(report_item->link)); 
    121        
     121
    122122        while(i<size){ 
    123123                if(!USB_HID_ITEM_IS_LONG(data[i])){
    124124
    125                         if((i+1) >= size){
     125                        if((i+USB_HID_ITEM_SIZE(data[i]))>= size){
    126126                                return -1; // TODO ERROR CODE
    127127                        }
     
    200200        }
    201201       
    202 
    203202        return EOK;
    204203}
     
    326325                case USB_HID_REPORT_TAG_COLLECTION:
    327326                        // TODO
     327                        return USB_HID_NO_ACTION;
    328328                        break;
    329329                       
    330330                case USB_HID_REPORT_TAG_END_COLLECTION:
    331331                        /* should be ignored */
     332                        return USB_HID_NO_ACTION;
    332333                        break;
    333334                default:
     
    335336        }
    336337
    337         return USB_HID_NO_ACTION;
     338        return EOK;
    338339}
    339340
Note: See TracChangeset for help on using the changeset viewer.