hda: prevent buffer overrun for associations array.

This commit is contained in:
Jessica Hamilton 2017-06-29 13:53:40 -07:00
parent a5fb17bc65
commit 8253046311

View File

@ -640,6 +640,10 @@ hda_widget_get_associations(hda_audio_group* audioGroup)
uint32 index = 0;
for (uint32 i = 0; i < MAX_ASSOCIATIONS; i++) {
for (uint32 j = 0; j < audioGroup->widget_count; j++) {
if (index >= MAX_ASSOCIATIONS) {
TRACE("too many associations, bailing!\n");
return B_ERROR;
}
hda_widget& widget = audioGroup->widgets[j];
if (widget.type != WT_PIN_COMPLEX)