Changeset 37b4794e in mainline for uspace/lib/usb/src/request.c


Ignore:
Timestamp:
2011-02-25T12:18:17Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0e3505a
Parents:
11f1817
Message:

More precise range checking with USB string index

File:
1 edited

Legend:

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

    r11f1817 r37b4794e  
    502502 *
    503503 * @param[in] pipe Control endpoint pipe (session must be already started).
    504  * @param[in] index String index (in native endianess).
     504 * @param[in] index String index (in native endianess),
     505 *      first index has number 1 (index from descriptors can be used directly).
    505506 * @param[in] lang String language (in native endianess).
    506507 * @param[out] string_ptr Where to store allocated string in native encoding.
     
    513514                return EBADMEM;
    514515        }
    515         /* Index is actually one byte value. */
    516         if (index > 0xFF) {
     516        /*
     517         * Index is actually one byte value and zero index is used
     518         * to retrieve list of supported languages.
     519         */
     520        if ((index < 1) || (index > 0xFF)) {
    517521                return ERANGE;
    518522        }
Note: See TracChangeset for help on using the changeset viewer.