8242685: Better Path Validation
Reviewed-by: alanb, rhalade
This commit is contained in:
parent
a5cb23e29f
commit
ff3e558679
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -83,7 +83,8 @@ class UnixUriUtils {
|
|||||||
if (b == 0)
|
if (b == 0)
|
||||||
throw new IllegalArgumentException("Nul character not allowed");
|
throw new IllegalArgumentException("Nul character not allowed");
|
||||||
} else {
|
} else {
|
||||||
assert c < 0x80;
|
if (c == 0 || c >= 0x80)
|
||||||
|
throw new IllegalArgumentException("Bad escape");
|
||||||
b = (byte)c;
|
b = (byte)c;
|
||||||
}
|
}
|
||||||
result[rlen++] = b;
|
result[rlen++] = b;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user