unixCurrentTime being aliased to NULL cause crashes with custom VFS v1 implementation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

unixCurrentTime being aliased to NULL cause crashes with custom VFS v1 implementation

Even Rouault
Hi,

The GDAL library uses a custom VFS implementation, which, for some operations
not related to the VFS (xRandomness, xSleep, xCurrentTime etc.) basically
forwards the call to the default VFS implementation like:

static int OGRSQLiteVFSCurrentTime(sqlite3_vfs* pVFS, double* p1)
{
    sqlite3_vfs* pUnderlyingVFS = GET_UNDERLYING_VFS(pVFS);
    return pUnderlyingVFS->xCurrentTime(pUnderlyingVFS, p1);
}

Up to now, it used iVersion = 1 of the VFS structure, i.e. not implementing
xCurrentTimeInt64.

Starting with SQLite 3.10.0, the unixCurrentTime function is now aliased to
the NULL pointer. Which caused the invokation of the xCurrentTime pointer of
the default VFS to dereference a null pointer function in the above code.

I've fixed/workarounded the issue ( details at
https://trac.osgeo.org/gdal/ticket/6360 ), but I thought I should still
mention that this change had compatibility issues.

Best regards,

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: unixCurrentTime being aliased to NULL cause crashes with custom VFS v1 implementation

Richard Hipp-3
On 2/10/16, Even Rouault <[hidden email]> wrote:
>
> Starting with SQLite 3.10.0, the unixCurrentTime function is now aliased to
> the NULL pointer.
>

Changed back for 3.11.0.  See the 4th bullet under "Bug Fixes" at
https://www.sqlite.org/draft/releaselog/3_11_0.html
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users