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 b05c45a60a2b1f5d31fd2cbdbdb7be05db757b44
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(

Reply via email to