Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3033: Increase array bounds and test for overflow #3042

Merged
merged 3 commits into from
Mar 21, 2025

Conversation

rppicomidi
Copy link
Contributor

Describe the PR
See issue #3033

Additional context
See issue #3033

@@ -254,7 +254,8 @@ bool midih_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *d
TU_LOG_DRV(" Jack %s %s descriptor \r\n",
tu_desc_subtype(p_desc) == MIDI_CS_INTERFACE_IN_JACK ? "IN" : "OUT",
p_desc[3] == MIDI_JACK_EXTERNAL ? "External" : "Embedded");
desc_cb.desc_jack[desc_cb.jack_num++] = p_desc;
if (desc_cb.jack_num < TU_ARRAY_SIZE(desc_cb.desc_jack))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put an bracket for if() { }

@hathach
Copy link
Owner

hathach commented Mar 21, 2025

I also notice at line 594 the statement is out of place, it is either part or default of get the wrong indent, would you mind double checkinging it. Thank you

default:
break;
cable_sysex_in_progress &= (uint16_t) ~cable_mask;

image

@rppicomidi
Copy link
Contributor Author

@hathach Good catch on line 594! Yes, that statement is out of place. Will fix it.

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thank you

@hathach hathach merged commit cf76af1 into hathach:master Mar 21, 2025
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants