Bug 1037409 - z88dk FTBFS if "-Werror=format-security" flag is used
Summary: z88dk FTBFS if "-Werror=format-security" flag is used
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: z88dk
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Kofler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1106700 (view as bug list)
Depends On:
Blocks: 1038083 F21FTBFS
TreeView+ depends on / blocked
 
Reported: 2013-12-03 06:08 UTC by Dhiru Kholia
Modified: 2015-07-09 21:45 UTC (History)
4 users (show)

Fixed In Version: z88dk-1.10.1-8.20150709cvs.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-09 21:45:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
FTBFS fix (413 bytes, patch)
2013-12-08 03:53 UTC, Dhiru Kholia
no flags Details | Diff
fixed .spec file (6.83 KB, text/x-rpm-spec)
2013-12-08 03:54 UTC, Dhiru Kholia
no flags Details

Description Dhiru Kholia 2013-12-03 06:08:38 UTC
Description of problem
----------------------

z88dk fails to build if "-Werror=format-security" flag is used.

...

die.c:69:5: error: format not a string literal and no format arguments [-Werror=format-security]

...

We are working on a proposal to enable "-Werror=format-security" for all
packages. Once this flag is enabled, GCC will refuse to compile code that could
be vulnerable to a string format security flaw. For more details, please see
https://fedorahosted.org/fesco/ticket/1185 page.

To understand why it is important to fix this, please see
https://fedoraproject.org/wiki/Format-Security-FAQ page.

How to fix this
---------------

The fix for these errors is quite simple. It's a matter of changing a
line like,

   printf(foo);

to read,

   printf("%s", foo);

That's it.

Please fix this issue in rawhide with a patch (which you should submit
to upstream to merge moving forward). Please do a new build with the
fix in rawhide. Other releases do not need to be directly fixed, but
there should be no harm in pushing out this fix/patch with other needed
changes to those branches.

In the event you don't fix this bug before the next mass rebuild,
provenpackagers may step in and update your package(s) to fix this
issue.

How reproducible
----------------

Build z88dk-1.10.1-3.fc20.src.rpm with "-Werror=format-security" flag to reproduce the problem.

To make this process easier, you can use a modified "redhat-rpm-config" package
from http://people.fedoraproject.org/~halfie/artifacts/redhat-rpm-config/ URL.

$ sha256sum redhat-rpm-config-9.1.0-56.fc20.*
faad7594b2080fe76497d0ce50808c905a93dd7b41c1defdde5ca57e3833d3d2  redhat-rpm-config-9.1.0-56.fc20.noarch.rpm
5aa9357174305c7285ffdbc92d7ffe1c07a8a95d5459b930461308f5aad75413  redhat-rpm-config-9.1.0-56.fc20.src.rpm

Comment 1 Dhiru Kholia 2013-12-08 03:53:53 UTC
Created attachment 834008 [details]
FTBFS fix

Comment 2 Dhiru Kholia 2013-12-08 03:54:50 UTC
Created attachment 834009 [details]
fixed .spec file

Comment 3 Dhiru Kholia 2013-12-08 03:59:55 UTC
Building this packages results in lot of warnings. Please coordinate with upstream to fix the code.

Even perfectly valid code isn't good / secure / useful by itself.

Comment 4 Kevin Kofler 2014-01-20 23:05:05 UTC
Thank you for the patch, but using fprintf with a "%s" format string is silly, that's what fputs is for. :-) That's what I'm going to use.

Comment 5 Kevin Kofler 2014-01-20 23:12:15 UTC
This is already fixed in upstream CVS (using fputs):
http://z88dk.cvs.sourceforge.net/viewvc/z88dk/z88dk/src/z80asm/die.c?hideattic=0&r1=1.9&r2=1.10

Comment 6 Kevin Kofler 2014-01-20 23:16:01 UTC
And in the latest upstram code, the functions simply look like this:
http://z88dk.cvs.sourceforge.net/viewvc/z88dk/z88dk/src/z80asm/lib/die.c?revision=1.3&view=markup

Upstream also fixed their warnings.

I need to upgrade to current CVS anyway because of bug #967408, so I will probably just do that.

Comment 7 Dhiru Kholia 2014-01-21 05:05:38 UTC
(In reply to Kevin Kofler from comment #4)
> Thank you for the patch, but using fprintf with a "%s" format string is
> silly, that's what fputs is for. :-) That's what I'm going to use.

heh ;)

Sounds good, thanks!

Comment 9 Kevin Kofler 2015-02-22 00:25:55 UTC
*** Bug 1106700 has been marked as a duplicate of this bug. ***

Comment 10 Jaroslav Reznik 2015-03-03 15:17:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 11 Kevin Kofler 2015-07-09 21:45:05 UTC
Fixed by upgrading to a new upstream snapshot.


Note You need to log in before you can comment on or make changes to this bug.