Skip to content

Commit

Permalink
TKSS-919: SM2Engine:checkInputBound should check len rather input.length
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshajiang committed Nov 14, 2024
1 parent 8e55437 commit 4331aa9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022, 2023, THL A29 Limited, a Tencent company. All rights reserved.
* Copyright (C) 2022, 2024, THL A29 Limited, a Tencent company. 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
Expand Down Expand Up @@ -258,8 +258,8 @@ private byte[] kdf(byte[] input, int keyLen) {
}

private static boolean checkInputBound(byte[] input, int offset, int len) {
return input != null && input.length > 0
&& offset >= 0 && len >= 0
return input != null
&& offset >= 0 && len > 0
&& (input.length >= (offset + len));
}
}

0 comments on commit 4331aa9

Please sign in to comment.