Limit namespace length.
Limit namespace length to 1000 characters to avoid memory or other potential issues. Bug: 281553712 Test: atest CtsJobSchedulerTestCases Change-Id: I8c99ce6c5e9a23a38f91a00bdf22e80d08389f32
This commit is contained in:
@@ -4124,6 +4124,10 @@ public class JobSchedulerService extends com.android.server.SystemService
|
||||
if (namespace.isEmpty()) {
|
||||
throw new IllegalArgumentException("namespace cannot be empty");
|
||||
}
|
||||
if (namespace.length() > 1000) {
|
||||
throw new IllegalArgumentException(
|
||||
"namespace cannot be more than 1000 characters");
|
||||
}
|
||||
namespace = namespace.intern();
|
||||
}
|
||||
return namespace;
|
||||
|
||||
Reference in New Issue
Block a user