Skip to content

Commit efc6331

Browse files
committed
Check offset in object related functions
1 parent fb38bd9 commit efc6331

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ public static Binary replaceRegionIdForObjectBinary(int newRegionId, Binary orig
219219
}
220220

221221
public static int getActualReadSize(String filePath, long fileSize, long offset, long length) {
222+
if (offset < 0) {
223+
throw new SemanticException(String.format("offset %d is less than 0.", offset));
224+
}
222225
if (offset >= fileSize) {
223226
throw new SemanticException(
224227
String.format(

0 commit comments

Comments
 (0)