Skip to content

Commit

Permalink
8286533: Key X509 usages
Browse files Browse the repository at this point in the history
Reviewed-by: mbalao, andrew
Backport-of: c2a13eef3642987386db1b4759507e30796c0acc
  • Loading branch information
Alexey Bakhtin authored and gnu-andrew committed Oct 10, 2022
1 parent 62b1b3e commit e09162a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jdk/src/share/classes/sun/security/util/DerInputStream.java
Expand Up @@ -272,6 +272,9 @@ public byte[] getOctetString() throws IOException {
throw new IOException("DER input not an octet string");

int length = getDefiniteLength(buffer);
if (length > buffer.available())
throw new IOException("short read of an octet string");

byte[] retval = new byte[length];
if ((length != 0) && (buffer.read(retval) != length))
throw new IOException("Short read of DER octet string");
Expand Down Expand Up @@ -497,6 +500,10 @@ private String readString(byte stringTag, String stringName,
stringName + " string");

int length = getDefiniteLength(buffer);
if (length > buffer.available())
throw new IOException("short read of " +
stringName + " string");

byte[] retval = new byte[length];
if ((length != 0) && (buffer.read(retval) != length))
throw new IOException("Short read of DER " +
Expand Down

0 comments on commit e09162a

Please sign in to comment.