Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3035 closed defect (fixed)

crash in cpl_vsil_win32.cpp when compiling as x64 under Windows

Reported by: swilc0x Owned by: warmerdam
Priority: normal Milestone: 1.6.2
Component: default Version: 1.5.4
Severity: major Keywords: win64
Cc: tamas

Description

There is a bug in char VSIWin32FilesystemHandler::ReadDir?( const char *pszPath ) that manifests as a crash under Windows when compiled as a 64bit target. There is no problem when compiled as a 32bit binary. The issue itself is that the variable 'hFile' is incorrectly declared as a long. 'hFile' should be declared as a intptr_t per the standard. This breaks on Windows when compiled as a 64bit binary because a long is 32bit whereas intptr_t is 64bit. The fix is trivial. Simply change:

long hFile;

to

intptr_t hFile;

Change History (2)

comment:1 Changed 10 years ago by warmerdam

Keywords: win64 added
Milestone: 1.6.2
Resolution: fixed
Status: newclosed
Version: unspecified1.5.4

I confirmed the handle type of _findfirst with MSDN.

The change has been applied in trunk (r17269), 1.6 branch (r17270) and 1.5 branch (r17271).

comment:2 Changed 10 years ago by warmerdam

Cc: tamas added

added Tamas as a cc as he is likely to be interested.

Note: See TracTickets for help on using tickets.