Skip to content

Commit

Permalink
hwc2: Validate bounds check for input parcel
Browse files Browse the repository at this point in the history
CRs-Fixed: 2517976
Change-Id: Iba254b3579cd2c258c3cf80fe234a0de7d75e599
  • Loading branch information
Subash Chander authored and Baldev Sahu committed Oct 22, 2019
1 parent 98abd17 commit fdfb51f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdm/libs/hwc/hwc_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ android::status_t HWCSession::HandleSetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;

if (dpy > HWC_DISPLAY_VIRTUAL) {
if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}

Expand All @@ -929,7 +929,7 @@ android::status_t HWCSession::HandleGetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;

if (dpy > HWC_DISPLAY_VIRTUAL) {
if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}

Expand All @@ -949,7 +949,7 @@ android::status_t HWCSession::HandleGetDisplayConfigCount(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;

if (dpy > HWC_DISPLAY_VIRTUAL) {
if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}

Expand Down

0 comments on commit fdfb51f

Please sign in to comment.