Index: modules/luni/src/main/java/java/util/Properties.java =================================================================== --- modules/luni/src/main/java/java/util/Properties.java (revision 613866) +++ modules/luni/src/main/java/java/util/Properties.java (working copy) @@ -280,6 +280,8 @@ if (++count < 4) { continue; } + } else if (count <= 4) { + throw new IllegalArgumentException(""); } mode = NONE; buf[offset++] = (char) unicode; @@ -398,12 +400,20 @@ } buf[offset++] = nextChar; } + if (mode == UNICODE && count <= 4) { + throw new IllegalArgumentException("Invalid unicode sequence"); + } if (keyLength == -1 && offset > 0) { keyLength = offset; } if (keyLength >= 0) { String temp = new String(buf, 0, offset); - put(temp.substring(0, keyLength), temp.substring(keyLength)); + String key = temp.substring(0, keyLength); + String value = temp.substring(keyLength); + if (mode == SLASH) { + value += "\u0000"; + } + put(key, value); } }