New compilers break on potentially passing NULL to printf

Bug #1945478 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdbtools (Debian)
New
Unknown
mdbtools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

While the build tries to hide the error (>dev/null 2>&1) it can be reproduced and then shows:

In function ‘printf’,
    inlined from ‘mdb_dump_catalog’ at catalog.c:198:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:112:10: error: ‘%-12s’ directive argument is null [-Werror=format-overflow=]
  112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

I've found that to be a real issue with new toolchains identifying a problem in the code.

FYI - I've reported the same upstream
  https://github.com/mdbtools/mdbtools/issues/352

And found a related Debian issue
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986575

Changed in mdbtools (Debian):
status: Unknown → New
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Upstream seems generally +1 I've revised my patch there and with that we are unlikely to carry an odd delta for this forever.

Uploading a fixed version to impish based on what is discussed there.

Changed in mdbtools (Ubuntu):
status: New → Fix Committed
tags: added: update-excuse
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mdbtools - 0.9.4-1ubuntu1

---------------
mdbtools (0.9.4-1ubuntu1) impish; urgency=medium

  * d/p/lp-1945478-Fix-gcc-11-error-directive-argument-is-null.patch: fix
    gcc-11 FTFBS (LP: #1945478)

 -- Christian Ehrhardt <email address hidden> Thu, 30 Sep 2021 09:56:21 +0200

Changed in mdbtools (Ubuntu):
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.