mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8242685: Better Path Validation
Reviewed-by: alanb, rhalade
This commit is contained in:
parent
a5cb23e29f
commit
ff3e558679
1 changed files with 3 additions and 2 deletions
|
@ -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 @@ class UnixUriUtils {
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue