Opened 11 years ago

Closed 11 years ago

#4307 closed defect (fixed)

gdal 1.7.3 fails to build with -Werror=format-security

Reported by: SpamapS Owned by: warmerdam
Priority: normal Milestone:
Component: ConfigBuild Version: unspecified
Severity: normal Keywords:
Cc:

Description

This was found while preparing v1.7.3 for the latest Ubuntu dev release, precise pangolin:

https://bugs.launchpad.net/ubuntu/+source/gdal/+bug/881064

:Open(GDALOpenInfo*)': dodsdataset2.cpp:1078:58: error: format not a string literal and no format arguments [-Werror=format-security] dodsdataset2.cpp: In member function 'virtual CPLErr DODSRasterBand::IReadBlock(int, int, void*)': dodsdataset2.cpp:1643:76: error: format not a string literal and no format arguments [-Werror=format-security] cc1plus: some warnings being treated as errors

make[3]: * o/dodsdataset2.lo Error 1 make[3]: Leaving directory `/«PKGBUILDDIR»/frmts/dods' make[2]: * [dods-install-obj] Error 2 make[2]: Leaving directory `/«PKGBUILDDIR»/frmts'

and

ogrdodsdatasource.cpp: In member function 'int OGRDODSDataSource::Open(const char*)': ogrdodsdatasource.cpp:159:48: error: format not a string literal and no format arguments [-Werror=format-security] cc1plus: some warnings being treated as errors

make[4]: * o/ogrdodsdatasource.lo Error 1 make[4]: Leaving directory `/build/gdal-LRI9SY/gdal-1.7.3/ogr/ogrsf_frmts/dods' make[3]: * [dods-target] Error 2 make[3]: Leaving directory `/build/gdal-LRI9SY/gdal-1.7.3/ogr/ogrsf_frmts' make[2]: * [sublibs] Error 2 make[2]: Leaving directory `/build/gdal-LRI9SY/gdal-1.7.3/ogr'

also in the ruby/swig bindings

gdal_wrap.cpp: In function 'void Debug(const char*, const char*)': gdal_wrap.cpp:1666:34: error: format not a string literal and no format arguments [-Werror=format-security] gdal_wrap.cpp: In function 'void Error(CPLErr, int, const char*)': gdal_wrap.cpp:1669:40: error: format not a string literal and no format arguments [-Werror=format-security] gdal_wrap.cpp: In function 'VALUE _wrap_Driver_create(int, VALUE*, VALUE)':

Minor patches to pass errors as args rather than format strings resolves the issues. Forcing the rebuild of swig/ruby/gdal_wrap.cpp was all that was needed to squelch the error there.

Attachments (1)

fix-gdal-format-security.patch (1.7 KB ) - added by SpamapS 11 years ago.

Download all attachments as: .zip

Change History (4)

by SpamapS, 11 years ago

comment:1 by Even Rouault, 11 years ago

Why is Ubuntu packaging 1.7.3 and not 1.8.1 for a new Ubuntu release ? I've checked but this has already been fixed in 1.8

comment:2 by SpamapS, 11 years ago

We're just waiting for the Debian maintainers to migrate to 1.8.x. It only entered "experimental" a week ago, and this is an LTS so we are playing conservative and waiting for things to land in 'testing'.

Thanks for checking, I'll consider the patch something we can drop as soon as 1.8.x arrives.

comment:3 by Even Rouault, 11 years ago

Resolution: fixed
Status: newclosed

Closing the ticket as (already) fixed

Note: See TracTickets for help on using tickets.