OpenJDK / jdk-updates / jdk11u
changeset 53509:30d70a2f1ed3
8242685: Better Path Validation
Reviewed-by: alanb, rhalade
author | bpb |
---|---|
date | Tue, 28 Apr 2020 10:14:25 -0700 |
parents | e831bc1ca2c7 |
children | 6ba85b2ad181 |
files | src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java Wed Apr 29 13:20:25 2020 -0700 +++ b/src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java Tue Apr 28 10:14:25 2020 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,7 +83,8 @@ if (b == 0) throw new IllegalArgumentException("Nul character not allowed"); } else { - assert c < 0x80; + if (c == 0 || c >= 0x80) + throw new IllegalArgumentException("Bad escape"); b = (byte)c; } result[rlen++] = b;