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

Commit 4de0740b authored by Nate(Qiang) Jiang's avatar Nate(Qiang) Jiang Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Limit the ServiceFriendlyNames" into rvc-qpr-dev

parents 472f9aa4 de8f0fef
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -842,6 +842,23 @@ public final class PasspointConfiguration implements Parcelable {
                }
            }
        }
        if (mServiceFriendlyNames != null) {
            if (mServiceFriendlyNames.size() > MAX_NUMBER_OF_ENTRIES) {
                Log.e(TAG, "ServiceFriendlyNames exceed the max!");
                return false;
            }
            for (Map.Entry<String, String> names : mServiceFriendlyNames.entrySet()) {
                if (names.getKey() == null || names.getValue() == null) {
                    Log.e(TAG, "Service friendly name entry should not be null");
                    return false;
                }
                if (names.getKey().length() > MAX_STRING_LENGTH
                        || names.getValue().length() > MAX_STRING_LENGTH) {
                    Log.e(TAG, "Service friendly name is to long");
                    return false;
                }
            }
        }
        return true;
    }