Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a8f0909 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hid: usbhid: Changes to prevent buffer overflow"

parents ba6634d9 dce8b9bf
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -510,13 +510,13 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
				goto inval;

			field = report->field[uref->field_index];
		}

		if (cmd == HIDIOCGCOLLECTIONINDEX) {
			if (uref->usage_index >= field->maxusage)
				goto inval;
		} else if (uref->usage_index >= field->report_count)
			goto inval;
		}

		if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) &&
		    (uref_multi->num_values > HID_MAX_MULTI_USAGES ||