Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8286533: Key X509 usages
Browse files Browse the repository at this point in the history
Reviewed-by: yan
  • Loading branch information
Alexey Bakhtin authored and Yuri Nesterenko committed Oct 18, 2022
1 parent 907ded0 commit 96e3fe3
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -275,6 +275,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 @@ -499,6 +502,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 96e3fe3

Please sign in to comment.