From 95b1048d390e79029978efd4654c05816722e17f Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 28 Jan 2015 17:56:32 -0800 Subject: [PATCH] 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 (cherry picked from commit e32df45fe1a8cb7286bfdad392a0d36e0ddcf8e7) Change-Id: I126a40ffae76ee6a06926e770ca015fb063a334b --- core/java/com/android/internal/os/ZygoteConnection.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java index 2ef8a20f7d9d6..4548221aa20cc 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java @@ -842,7 +842,12 @@ class ZygoteConnection { 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) {