Bug 1003035 - cups-filters: pdfOut_printf format string mismatches
cups-filters: pdfOut_printf format string mismatches
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cups-filters (Show other bugs)
7.0
Unspecified Unspecified
low Severity unspecified
: rc
: ---
Assigned To: Tim Waugh
Petr Sklenar
:
Depends On:
Blocks: 1002935
  Show dependency treegraph
 
Reported: 2013-08-30 10:25 EDT by Florian Weimer
Modified: 2014-06-17 23:51 EDT (History)
1 user (show)

See Also:
Fixed In Version: cups-filters-1.0.35-9.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-27 10:22:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Florian Weimer 2013-08-30 10:25:34 EDT
After adding this

void pdfOut_printf(pdfOut *pdf,const char *fmt,...)
  __attribute__((format(printf, 2, 3)));

to filter/pdfutils.h, I get these format string mismatches:

filter/pdfutils.c:246:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
                      pdf->xref[iA]);
                      ^~~~~~~~~~~~~
filter/pdfutils.c:352:29: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
                    ,l0_obj,streamsize);
                            ^~~~~~~~~~
filter/texttopdf.c:255:29: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
                    len_obj,size);
                            ^~~~

This looks harmless (int is promoted to long in varargs anyway).
Comment 1 Florian Weimer 2013-08-30 10:34:33 EDT
Similarly, applying this to fontembed/dynstring.h

int dyn_printf(DYN_STRING *ds,const char *fmt,...)
  __attribute__((format(printf, 2, 3)));

yields:

fontembed/embed_sfnt.c:522:20: warning: invalid conversion specifier '!' [-Wformat-invalid-specifier]
  dyn_printf(&ds,"%!PS-TrueTypeFont-%d-%d\n",
                  ~^
fontembed/embed_sfnt.c:522:41: warning: more '%' conversions than data arguments [-Wformat]
  dyn_printf(&ds,"%!PS-TrueTypeFont-%d-%d\n",
                                       ~^
That's equally harmless.
Comment 3 Tim Waugh 2013-10-01 08:13:38 EDT
Filed as Fedora bug #1014093.

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