Opened 16 years ago

Closed 16 years ago

#2022 closed defect (fixed)

VSIFOpenL crashes if given a directory, causes problems at least in GPX driver

Reported by: Ari Jolma Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: gpx
Cc:

Description

At least the docs for VSIFOpenL should mention that it does not accept directories.

Also

if (VSI_ISDIR(sStatBuf.st_mode))
        return FALSE;

should be on ogrgpxdatasource.cpp:189

In addition, shouldn't it be possible to specify which drivers to include in GDAL?

Ari

Change History (6)

comment:1 by Even Rouault, 16 years ago

Ari, I've commited in r13024 the test you suggested. However I couldn't reproduce the crash you mentionned. I'm using Linux. Maybe it occurs on Windows ?

comment:2 by warmerdam, 16 years ago

I vaguely recall Ari mentioning a problem previously with passing a directory to VSIFOpenL() and there was some sort of action. But I don't recall the details. Ari, can you put this in context?

comment:3 by Ari Jolma, 16 years ago

Me too :) The problem was similar, giving GPX driver a directory as a data source. I could not find the ticket if I submitted one.

I did not investigate any deeper. I'm mostly testing on Windows now, so maybe the VSIFOpenL thing is a Windows-related problem, but the directory test was warranted in any case. Thanks.

comment:4 by warmerdam, 16 years ago

Keywords: gpx added

Ari,

I found:

http://lists.osgeo.org/pipermail/gdal-dev/2007-November/014871.html

The problem in that case seemed to be that VSIFOpenL() succeeded on directories (on windows perhaps?) but reads would always fail with zero bytes read however VSIFEofL() did not indicate the end of file had been reached.

In that case it caused a hang.

Is this report about the same issue? If so, it should already have been fixed. If not, I'd like to know.

comment:5 by Ari Jolma, 16 years ago

I believe my first diagnosis was wrong. The problem was not in VSIFOpenL with a directory. The problem was ogrgpxdatasource.cpp not checking the return value of VSIFOpenL. Sorry for a crappy diagnosis.

Ari

comment:6 by Even Rouault, 16 years ago

Resolution: fixed
Status: newclosed

Well, that's not a crappy diagnosis to point out a missing test after VSIFOpenL ;-). Thanks ! Fixed in r13033

Note: See TracTickets for help on using tickets.