Bug 246219 - gpm uses variable argument lists incorrectly
Summary: gpm uses variable argument lists incorrectly
Alias: None
Product: Fedora
Classification: Fedora
Component: gpm   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tomas Janousek
QA Contact: Fedora Extras Quality Assurance
Keywords: EasyFix
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2007-06-29 11:48:32 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 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):


How reproducible:

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

Steps to Reproduce:
Actual results:

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

Expected results:

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.