Bug 106310

Summary: Format string issues in XFree86 source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: XFree86Assignee: X/OpenGL Maintenance List <xgl-maint>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-12 07:30:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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"