This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch force_ci/object_type in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit efc633100da62e82010dbdf3aab7437698adcdb6 Author: JackieTien97 <[email protected]> AuthorDate: Tue Dec 16 18:44:24 2025 +0800 Check offset in object related functions --- .../src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java index aebcaf9a4dd..0d3d9f963bb 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java @@ -219,6 +219,9 @@ public class ObjectTypeUtils { } public static int getActualReadSize(String filePath, long fileSize, long offset, long length) { + if (offset < 0) { + throw new SemanticException(String.format("offset %d is less than 0.", offset)); + } if (offset >= fileSize) { throw new SemanticException( String.format(
