Sprintf without format string

Bug #1208860 reported by Pasi Kallinen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSRF
Fix Released
Undecided
Unassigned

Bug Description

In Debian testing, OpenSRF compile will fail because gcc is strict about sprintf and friends' format:

./osrf_http_translator.c: In function 'osrfHttpTranslatorParseRequest':
./osrf_http_translator.c:299:25: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
In file included from /usr/include/apache2/httpd.h:64:0,
                 from ./apachetools.h:4,
                 from ./osrf_http_translator.c:5:
/usr/include/stdlib.h:482:13: note: expected 'void *' but argument is of type 'const char *'
./osrf_http_translator.c: In function 'osrfHttpTranslatorProcess':
./osrf_http_translator.c:483:21: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
apxs:Error: Command failed with rc=65536

Fix is in http://git.evergreen-ils.org/?p=working/OpenSRF.git;a=shortlog;h=refs/heads/user/paxed/fix-sprintf-format

Galen Charlton (gmc)
Changed in opensrf:
status: New → Confirmed
assignee: nobody → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

In particular, looks like gcc when run by the APR toolchain now gets -Werror=format-security.

Pushed to master and rel_2_2; on Debian stable it gets rid of a warning during 'make install', so has utility for those not playing with Debian testing yet.

Thanks, Pasi!

Changed in opensrf:
status: Confirmed → Fix Committed
Galen Charlton (gmc)
Changed in opensrf:
milestone: none → 2.2.1
Galen Charlton (gmc)
Changed in opensrf:
assignee: Galen Charlton (gmc) → nobody
Galen Charlton (gmc)
Changed in opensrf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.