mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-17 10:20:33 +00:00
8267860: Off-by-one bug when searching arrays in AlpnGreaseTest
Co-authored-by: Bradford Wetmore <wetmore@openjdk.org> Reviewed-by: wetmore
This commit is contained in:
parent
4aede33fbf
commit
2adef6a1f8
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, 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,7 @@ public class AlpnGreaseTest implements SSLContextTemplate {
|
||||
new String(greaseBytes, StandardCharsets.ISO_8859_1);
|
||||
|
||||
private static void findGreaseInClientHello(byte[] bytes) throws Exception {
|
||||
for (int i = 0; i < bytes.length - greaseBytes.length; i++) {
|
||||
for (int i = 0; i < bytes.length - greaseBytes.length + 1; i++) {
|
||||
if (Arrays.equals(bytes, i, i + greaseBytes.length,
|
||||
greaseBytes, 0, greaseBytes.length)) {
|
||||
System.out.println("Found greaseBytes in ClientHello at: " + i);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user