Bug 106310 - Format string issues in XFree86 source code
Summary: Format string issues in XFree86 source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-05 09:37 UTC by d.binderman
Modified: 2007-04-18 16:58 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-12 07:30:53 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2003-10-05 09:37:01 UTC
Description of problem:

Hello there,

I just tried to compile package vnc-3.3.3r2-47, from Redhat 9.0,
with compiler flag -Wall.

The compiler said

makestrs.c:390: warning: too few arguments for format

The source code is

                (void) printf ("%s %sConst char %s%s[] = \"%s\";\n",
                               externdefstr, conststr ? conststr : prefixstr,
                               te->left, te->right);

Five % specifiers, only four parameters. Worth fixing. The compiler also
said

set_trns.c:137: warning: operation on `pointer' may be undefined

The source code is

n = ((format & BIT6)? (fix15)NEXT_BYTE(pointer): 0) +
    ((format & BIT7)? (fix15)NEXT_BYTE(pointer): 0);

Better with

n = ((format & BIT6)? (fix15)NEXT_BYTE(pointer): 0);
n += ((format & BIT7)? (fix15)NEXT_BYTE(pointer): 0);

The compiler also said

token.c:108: warning: operation on `exponent' may be undefined

    exponent = -(++exponent >> 1); /* portable C for -(exponent/2) */

It's funny how the comment is completely wrong. This isn't portable
C at all.

There were many more warnings produced by the compiler.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 1 Tim Waugh 2003-10-08 09:22:35 UTC
(These come from XFree86.)

Comment 2 Mike A. Harris 2003-10-08 23:05:29 UTC
There are various format string related issues in the X source code, of which
I am planning on addressing some time in the next few months once I'm able
to allocate time for the investigation.  I'll provide status here as new
details emerge.

Comment 3 Mike A. Harris 2004-10-12 07:30:53 UTC
Numerous format string related bugs were fixed in XFree86 CVS since
this report was filed, and should be present in Fedora Core 2.

If new format string bugs are discovered, or any compile time
warning tripping issues are discovered in newer compilers, please
file them directly in X.Org bugzilla which is located at:

   http://bugs.freedesktop.org

Setting bug status to "RAWHIDE"


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