Bug 956707 - scl-utils: missing format attribute on sprintf wrapper
Summary: scl-utils: missing format attribute on sprintf wrapper
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: scl-utils
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jan Zeleny
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On: 953520
Blocks: 953462 957183
TreeView+ depends on / blocked
 
Reported: 2013-04-25 13:10 UTC by Jan Zeleny
Modified: 2013-09-30 22:05 UTC (History)
5 users (show)

Fixed In Version: scl-utils-20120927-5.el5
Doc Type: Bug Fix
Doc Text:
Clone Of: 953520
: 957183 (view as bug list)
Environment:
Last Closed: 2013-09-30 22:05:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1303 0 normal SHIPPED_LIVE scl-utils bug fix update 2013-09-30 21:13:39 UTC

Description Jan Zeleny 2013-04-25 13:10:16 UTC
+++ This bug was initially created as a clone of Bug #953520 +++

Adding

static void check_asprintf( char **strp, const char *fmt, ... )
  __attribute__((format(printf, 2, 3)));

reveals the following misuse of check_asprintf:

scl.c: In function ‘list_packages_in_collection’:
scl.c:207:2: warning: too many arguments for format [-Wformat-extra-args]
  check_asprintf(&cmd, "rpm -qa --qf=\"#%%{name}-%%{version}-%%{release}.%%{arch}\n%%{sourcerpm}\n[%%{provides}\n]\"", colname);
  ^

--- Additional comment from Jindrich Novy on 2013-04-23 15:37:08 CEST ---

Hi Florian,

sorry, I don't get it. Why would you add __attribute__((format(printf, 2, 3)) to the check_asprintf() line to trigger this?

--- Additional comment from Florian Weimer on 2013-04-23 15:48:29 CEST ---

The attribute allows GCC to perform additional type checking.  The warning is quite  correct because the format string does not contain "%s", so the colname is either superfluous, or something is missing from the format string.

Comment 1 RHEL Program Management 2013-04-25 13:29:29 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 5 errata-xmlrpc 2013-09-30 22:05:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1303.html


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