Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
In the file gridmix/AvgRecordFactory.java, one of the class's constructor has the following code:
public AvgRecordFactory(long targetBytes, long targetRecords, Configuration conf, int minSpilledBytes) { this.targetBytes = targetBytes; this.targetRecords = targetRecords <= 0 && this.targetBytes >= 0 ? Math.max(1, this.targetBytes / conf.getInt(GRIDMIX_MISSING_REC_SIZE, 64 * 1024)) : targetRecords; final long tmp = this.targetBytes / this.targetRecords; ... }
The check in the code targetRecords <= 0 && this.targetBytes >= 0 is not sufficient: when targetRecords == 0 && targetBytes < 0, we can bypass the protection checking and set this.targetRecords to zero, leading to a divide by zero problem when computing tmp.
Attachments
Issue Links
- links to