Bug 246219 - gpm uses variable argument lists incorrectly
gpm uses variable argument lists incorrectly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gpm (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Tomas Janousek
Fedora Extras Quality Assurance
: EasyFix
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-29 06:45 EDT by Lubomir Kundrak
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: gpm-1.20.1-85.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-29 07:48:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Lubomir Kundrak 2007-06-29 06:45:41 EDT
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 06:45:42 EDT
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.