Bug 106310 - Format string issues in XFree86 source code
Format string issues in XFree86 source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: X/OpenGL Maintenance List
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-05 05:37 EDT by d.binderman
Modified: 2007-04-18 12:58 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-12 03:30:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2003-10-05 05:37:01 EDT
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 05:22:35 EDT
(These come from XFree86.)
Comment 2 Mike A. Harris 2003-10-08 19:05:29 EDT
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 03:30:53 EDT
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.