Bug 953520 - scl-utils: missing format attribute on sprintf wrapper
Summary: scl-utils: missing format attribute on sprintf wrapper
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: scl-utils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Zeleny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 953462 956707 957183
TreeView+ depends on / blocked
 
Reported: 2013-04-18 11:16 UTC by Florian Weimer
Modified: 2013-06-29 18:51 UTC (History)
3 users (show)

Fixed In Version: scl-utils-20130529-1.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 956707 (view as bug list)
Environment:
Last Closed: 2013-06-29 18:51:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2013-04-18 11:16:10 UTC
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);
  ^

Comment 1 Jindrich Novy 2013-04-23 13:37:08 UTC
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?

Comment 2 Florian Weimer 2013-04-23 13:48:29 UTC
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 3 Fedora Update System 2013-06-19 08:21:06 UTC
scl-utils-20130529-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/scl-utils-20130529-1.fc18

Comment 4 Fedora Update System 2013-06-19 08:21:45 UTC
scl-utils-20130529-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/scl-utils-20130529-1.fc19

Comment 5 Fedora Update System 2013-06-19 13:08:25 UTC
Package scl-utils-20130529-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing scl-utils-20130529-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11254/scl-utils-20130529-1.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-06-29 18:51:10 UTC
scl-utils-20130529-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


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