Bug 189146 - xvidtune crashes on startup due to gcc fortify
Summary: xvidtune crashes on startup due to gcc fortify
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-server-utils
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-17 16:47 UTC by Frank Ch. Eigler
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-08-04 21:20:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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

Version-Release number of selected component (if applicable):
xorg-x11-server-utils-1.0.1-1.2

How reproducible:
always

Steps to Reproduce:
1. run xvidtune
  
Actual results:
crash

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 /
1000.0);
(gdb) l
963         Widget wids[3];
964         char buf[10];
965
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 /
1000.0);
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 21:20:23 UTC
Fixed in 7.1-4 and later.


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