Skip to content
Snippets Groups Projects
Commit 6b1746ab authored by Nate(Qiang) Jiang's avatar Nate(Qiang) Jiang
Browse files

DO NOT MERGE: Limit the ServiceFriendlyNames

Bug: 274445194
Test: atest android.net.wifi
Change-Id: Id4e16007531ba1ce3e3f9fa3d3111b5af57751be
parent 2f02357e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment