Bug 246219

Summary: gpm uses variable argument lists incorrectly
Product: [Fedora] Fedora Reporter: Lubomir Kundrak <lkundrak>
Component: gpmAssignee: Tomas Janousek <tjanouse>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideKeywords: EasyFix
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 11:48:32 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:
Attachments:
Description Flags
Fix to incorrect use of variable argument lists in gpm's gpm_report() none

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()