Skip to content

Commit 7e76808

Browse files
authored
Merge pull request #255 from fdesbiens/dev
Pre v6.5.0.202601 fixes
2 parents 47f337f + b20e7ef commit 7e76808

File tree

35 files changed

+50
-71
lines changed

35 files changed

+50
-71
lines changed

common/usbx_host_classes/inc/ux_host_class_hid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ UINT _ux_host_class_hid_report_decompress(UX_HOST_CLASS_HID *hid, UX_HOST_CLA
10691069
UINT _ux_host_class_hid_report_descriptor_get(UX_HOST_CLASS_HID *hid, ULONG length);
10701070
UINT _ux_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
10711071
UINT _ux_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id);
1072-
UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item);
1072+
UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, ULONG length, UX_HOST_CLASS_HID_ITEM *item);
10731073
UINT _ux_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
10741074
UINT _ux_host_class_hid_resources_free(UX_HOST_CLASS_HID *hid);
10751075
VOID _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_request);

common/usbx_host_classes/src/ux_host_class_hid_entry.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ UINT status = UX_SUCCESS;
358358
{
359359

360360
/* Get one item from the report and analyze it. */
361-
_ux_host_class_hid_report_item_analyse(descriptor, &item);
361+
_ux_host_class_hid_report_item_analyse(descriptor, length, &item);
362362

363363
/* Point the descriptor right after the item identifier. */
364364
descriptor += item.ux_host_class_hid_item_report_format;

common/usbx_host_classes/src/ux_host_class_hid_report_descriptor_get.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ UINT status;
111111
{
112112
/* Get one item from the report and analyze it. */
113113
/* Make sure this descriptor has at least the minimum length. */
114-
analysis_failure = _ux_host_class_hid_report_item_analyse(descriptor, &item);
114+
analysis_failure = _ux_host_class_hid_report_item_analyse(descriptor, length, &item);
115115
if (analysis_failure)
116116
{
117117
/* Error trap. */

common/usbx_host_classes/src/ux_host_class_hid_report_item_analyse.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
/* INPUT */
4848
/* */
4949
/* descriptor Pointer to descriptor */
50+
/* length Length of descriptor */
5051
/* item Pointer to item */
5152
/* */
5253
/* OUTPUT */
@@ -62,12 +63,18 @@
6263
/* HID Class */
6364
/* */
6465
/**************************************************************************/
65-
UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item)
66+
UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, ULONG length, UX_HOST_CLASS_HID_ITEM *item)
6667
{
6768

6869
UCHAR item_byte;
6970
UINT result = UX_SUCCESS;
7071

72+
/* Make sure descriptor has minimal length.*/
73+
if (length == 0)
74+
{
75+
return(UX_DESCRIPTOR_CORRUPTED);
76+
}
77+
7178
/* Get the first byte from the descriptor. */
7279
item_byte = *descriptor;
7380

@@ -83,7 +90,7 @@ UINT result = UX_SUCCESS;
8390
item -> ux_host_class_hid_item_report_type = (item_byte >> 2) & 3;
8491

8592
/* Make sure descriptor has minimal length.*/
86-
if (sizeof(descriptor) >= 3)
93+
if (length >= 3)
8794
{
8895
/* Get its length (byte 1). */
8996
item -> ux_host_class_hid_item_report_length = (USHORT) *(descriptor + 1);
@@ -120,11 +127,14 @@ UINT result = UX_SUCCESS;
120127
/* Set the type. */
121128
item -> ux_host_class_hid_item_report_type = (item_byte >> 2) & 3;
122129

123-
/* Set the tag. */
124-
item -> ux_host_class_hid_item_report_tag = item_byte >> 4;
130+
/* Then the tag. */
131+
item -> ux_host_class_hid_item_report_tag = (item_byte >> 4) & 0xf;
132+
133+
/* Mark its format. For short items, this is always 1. */
134+
item -> ux_host_class_hid_item_report_format = 1;
135+
125136
}
126137

127-
/* Return successful completion. */
138+
/* Return result. */
128139
return(result);
129140
}
130-

ports/arm9/gnu/inc/ux_port.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ VOID outpl(ULONG,ULONG);
244244

245245
#ifdef UX_SYSTEM_INIT
246246
CHAR _ux_version_id[] =
247-
"Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/GNU Version 6.4.1 *";
248-
* Copyright (c) 2026-present Eclipse ThreadX contributors
247+
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX ARM9/GNU Version 6.5.0.202601 *";
249248
#else
250249
extern CHAR _ux_version_id[];
251250
#endif

ports/arm9/iar/inc/ux_port.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ VOID outpl(ULONG,ULONG);
251251

252252
#ifdef UX_SYSTEM_INIT
253253
CHAR _ux_version_id[] =
254-
"Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/IAR Version 6.4.1 *";
255-
* Copyright (c) 2026-present Eclipse ThreadX contributors
254+
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX ARM9/IAR Version 6.5.0.202601 *";
256255
#else
257256
extern CHAR _ux_version_id[];
258257
#endif

ports/cortex_a15/gnu/inc/ux_port.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ VOID outpl(ULONG,ULONG);
240240

241241
#ifdef UX_SYSTEM_INIT
242242
CHAR _ux_version_id[] =
243-
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A15/GNU Version 6.4.1 *";
244-
* Copyright (c) 2026-present Eclipse ThreadX contributors
243+
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A15/GNU Version 6.5.0.202601 *";
245244
#else
246245
extern CHAR _ux_version_id[];
247246
#endif

ports/cortex_a5/gnu/inc/ux_port.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ VOID outpl(ULONG,ULONG);
247247

248248
#ifdef UX_SYSTEM_INIT
249249
CHAR _ux_version_id[] =
250-
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5/GNU Version 6.4.1 *";
251-
* Copyright (c) 2026-present Eclipse ThreadX contributors
250+
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A5/GNU Version 6.5.0.202601 *";
252251
#else
253252
extern CHAR _ux_version_id[];
254253
#endif

ports/cortex_a5/iar/inc/ux_port.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ VOID outpl(ULONG,ULONG);
247247

248248
#ifdef UX_SYSTEM_INIT
249249
CHAR _ux_version_id[] =
250-
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5/IAR Version 6.4.1 *";
251-
* Copyright (c) 2026-present Eclipse ThreadX contributors
250+
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A5/IAR Version 6.5.0.202601 *";
252251
#else
253252
extern CHAR _ux_version_id[];
254253
#endif

ports/cortex_a5x/ac6/inc/ux_port.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ VOID outpl(ULONG,ULONG);
264264

265265
#ifdef UX_SYSTEM_INIT
266266
CHAR _ux_version_id[] =
267-
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5x/AC6 Version 6.4.1 *";
268-
* Copyright (c) 2026-present Eclipse ThreadX contributors
267+
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A5x/AC6 Version 6.5.0.202601 *";
269268
#else
270269
extern CHAR _ux_version_id[];
271270
#endif

0 commit comments

Comments
 (0)