Opened 15 years ago

Closed 15 years ago

#3140 closed defect (fixed)

Integer overflow in IdrisiRasterBand::IWriteBlock

Reported by: riks Owned by: ilucena
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.6.2
Severity: normal Keywords: idrisi
Cc: warmerdam

Description

In IdrisiDataset.cpp line 1391, function VSIFSeekL is called, which takes a vsi_l_offset as second parameter. The value passes as second argument is

nRecordSize * nBlockYOff

, both of which are int's. This causes an overflow on compilers where an int cannot hold the result of the multiplication. As a result large .rst files are not read/written correctly.

Suggest to change the call to VSIFSeekL to:

VSIFSeekL( poGDS->fp, vsi_l_offset(nRecordSize) * nBlockYOff, SEEK_SET );

This error occurs on lines 1330, 1391 and 1407 in file IdrisiDataset.cpp.

Change History (3)

comment:1 by warmerdam, 15 years ago

Cc: warmerdam added
Keywords: idrisi added
Owner: changed from warmerdam to ilucena

comment:2 by ilucena, 15 years ago

Status: newassigned

comment:3 by ilucena, 15 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.