Bug 953520

Summary: scl-utils: missing format attribute on sprintf wrapper
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: scl-utilsAssignee: Jan Zeleny <jzeleny>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bkabrda, jnovy, jzeleny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: scl-utils-20130529-1.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 956707 (view as bug list) Environment:
Last Closed: 2013-06-29 18:51:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 953462, 956707, 957183    

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.