Bug 189146

Summary: xvidtune crashes on startup due to gcc fortify
Product: [Fedora] Fedora Reporter: Frank Ch. Eigler <fche>
Component: xorg-x11-server-utilsAssignee: X/OpenGL Maintenance List <xgl-maint>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-04 17:20:23 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Frank Ch. Eigler 2006-04-17 12:47:15 EDT
Description of problem:
xvidtune crashes.  gcc fortify backtrace produced.

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

How reproducible:

Steps to Reproduce:
1. run xvidtune
Actual results:

Expected results:
no crash

Additional info:
glibc detects a buffer overflow in the sprintf.  A 10-byte buffer is not big
enough to contain a number that large.

(gdb) frame 11
#11 0x0804af70 in CreateTyp (form=0x8fc5100, findex=PixelClock, w1name=Variable
"w1name" is not available.
    at xvidtune.c:968
968             (void) sprintf(buf, "%6.2f", (float)AppRes.field[findex].val /
(gdb) l
963         Widget wids[3];
964         char buf[10];
966         wids[0] = XtCreateWidget (w1name, labelWidgetClass, form, NULL, 0);
967         if (findex >= PixelClock && findex <= VSyncRate)
968             (void) sprintf(buf, "%6.2f", (float)AppRes.field[findex].val /
969         else
970             (void) sprintf (buf, "%5d", AppRes.field[findex].val);
971         wids[1] = XtVaCreateWidget (w2name, labelWidgetClass,
972                     form, XtNlabel, buf, NULL);

(gdb) p buf
$5 = "1889173.9"    # note 9 bytes + \0 used; no space for second decimal place
Comment 1 Adam Jackson 2006-08-04 17:20:23 EDT
Fixed in 7.1-4 and later.