Bug 1003035 - cups-filters: pdfOut_printf format string mismatches
Summary: cups-filters: pdfOut_printf format string mismatches
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cups-filters
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: Petr Sklenar
URL:
Whiteboard:
Depends On:
Blocks: 1002935
TreeView+ depends on / blocked
 
Reported: 2013-08-30 14:25 UTC by Florian Weimer
Modified: 2014-06-18 03:51 UTC (History)
1 user (show)

Fixed In Version: cups-filters-1.0.35-9.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-27 14:22:48 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Florian Weimer 2013-08-30 14:25:34 UTC
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 14:34:33 UTC
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 12:13:38 UTC
Filed as Fedora bug #1014093.


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