Bug 246219 - gpm uses variable argument lists incorrectly
Summary: gpm uses variable argument lists incorrectly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gpm
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tomas Janousek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-29 10:45 UTC by Lubomir Kundrak
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version: gpm-1.20.1-85.fc8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-29 11:48:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Fix to incorrect use of variable argument lists in gpm's gpm_report() (3.89 KB, patch)
2007-06-29 10:45 UTC, Lubomir Kundrak
no flags Details | Diff

Description Lubomir Kundrak 2007-06-29 10:45:41 UTC
Description of problem:

If compiled with vsyslog() support (which is always present in Fedora's libc),
gpm's gpm_report() function uses the same variable argument list structure
twice (once for syslog, once for terminal output). This is incorrect, as the
structure keeps reference index of last argument that was gotten via call to
va_get(). And thus, when it comes to terminal input vprintf(), there are no
arguments left on, and it gets and in turn dereferences random values from the
stack, which often triggers a Segmentation Fault.

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

gpm-1.20.1-84

How reproducible:

Trigger a log message that is a format string with one or more format
specifiers.

Steps to Reproduce:
1. gpm -KWAK_KWAK_KWAK_KWAK
  
Actual results:

$ gpm -KWAK_KWAK_KWAK_KWAK
gpm: invalid option -- K
*** err [gpn.c(43)]: Segmentation fault (core dumped)
$ 

Expected results:

$ gpm -KWAK_KWAK_KWAK_KWAK
gpm: invalid option -- K
*** err [gpn.c(43)]: Error in the commandline specification. Try "gpm -h".

$ 

Additional info:

The patch to fix the issue is attached.

Comment 1 Lubomir Kundrak 2007-06-29 10:45:42 UTC
Created attachment 158192 [details]
Fix to incorrect use of variable argument lists in gpm's gpm_report()


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