8336667: IAE in DerInputStream.toByteArray

Reviewed-by: valeriep
This commit is contained in:
Weijun Wang 2024-07-25 17:11:59 +00:00
parent cf0d9e0e52
commit b5b5a5b8e5
3 changed files with 113 additions and 2 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2024, 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
@ -114,7 +114,7 @@ public class DerInputStream {
// to the end of return value by DerIndefLenConverter::convertBytes
// and stay inside result.buffer.
int unused = result.buffer.length - result.end;
this.pos = this.data.length - unused;
this.pos = this.end - unused;
} else {
this.pos = result.end;
}