Bison generated code triggers -Werror=format-security

Bug #890434 reported by Michael Terry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bison (Debian)
Fix Released
Unknown
bison (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

As seen in a nip2 FTBFS [1], bison generated parsers can trigger "error: format not a string literal and no format arguments [-Werror=format-security]" errors.

Fix is to use '"%s", yymsg' instead. Fix coming.

[1] https://launchpadlibrarian.net/83734136/buildlog_ubuntu-precise-i386.nip2_7.26.3-1_FAILEDTOBUILD.txt.gz

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bison - 1:2.5.dfsg-2ubuntu1

---------------
bison (1:2.5.dfsg-2ubuntu1) precise; urgency=low

  * Grab latest bison from Debian unstable, which fixes a FTBFS in
    bison itself due to -Werror=format-security
  * debian/patches/use-format-literals.patch:
    - Fix generated code to not trigger "error: format not a string
      literal and no format arguments [-Werror=format-security]" errors.
      LP: #890434

bison (1:2.5.dfsg-2) unstable; urgency=low

  * Rename liby-dev to libbison-dev to avoid name conflict with Y sound
    server library header files (closes: #644200)

bison (1:2.5.dfsg-1) unstable; urgency=low

  * New upstream release (closes: #631607, #643358)
  * Update Standards-Version to 3.9.2.0
  * Fixed all lintian warnings
  * Convert package to 3.0 (quilt) format
  * Move liby.a to the new liby-dev package for multiarch support. Thanks
    to Riku Voipio <email address hidden> for patch (closes: #642081)
 -- Michael Terry <email address hidden> Mon, 14 Nov 2011 16:47:52 -0500

Changed in bison (Ubuntu):
status: New → Fix Released
Changed in bison (Debian):
status: Unknown → New
Changed in bison (Debian):
status: New → Fix Released
Revision history for this message
Kees Cook (kees) wrote :

Based on the upstream documentation for yyerror:

http://www.gnu.org/software/bison/manual/html_node/Error-Reporting.html

These are bugs in the _implementations_ of yyerror, not the definition of yyerror. The fix for this patch introduces bugs in all the glr yyerror users:

https://bugs.launchpad.net/ubuntu/+source/bison/+bug/949732

I recommend reverting this fix and just syncing the latest from Debian that includes a minor package versioning fix instead. Clients (like nip2) should be fixed individually. (See the example from the upstream documentation where it uses %s correctly.)

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.