| commit | e32df45fe1a8cb7286bfdad392a0d36e0ddcf8e7 | [log] [tgz] |
|---|---|---|
| author | Christopher Ferris <cferris@google.com> | Wed Jan 28 17:56:32 2015 -0800 |
| committer | Christopher Ferris <cferris@google.com> | Thu Jan 29 12:20:06 2015 -0800 |
| tree | f280fe63b54d7fd14428640c26d3405ec304202e | |
| parent | 106da5bf80d182a2e6fd346e1836ae4fc0ba1d92 [diff] |
Fix wrap property creation when truncating. If a property name gets truncated, make sure it doesn't end in a '.' since that makes the name illegal. Bug: 19196358 Bug: https://code.google.com/p/android/issues/detail?id=82947 Change-Id: Icc1a26593237ca19ad0ebd776a60b3d6290bb355
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java index aba4bd0..0eb52cb 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -800,7 +800,12 @@ if (args.niceName != null) { String property = "wrap." + args.niceName; if (property.length() > 31) { - property = property.substring(0, 31); + // Avoid creating an illegal property name when truncating. + if (property.charAt(30) != '.') { + property = property.substring(0, 31); + } else { + property = property.substring(0, 30); + } } args.invokeWith = SystemProperties.get(property); if (args.invokeWith != null && args.invokeWith.length() == 0) {