Bug 787147

Summary: vga_getmodenumber() segmentation fault
Product: [Fedora] Fedora Reporter: Ozkan Sezer <sezeroz>
Component: svgalibAssignee: Jaromír Cápík <jcapik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: orion, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: svgalib-1.9.25-14.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-02 06:27:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
svgalib vga_getmodenumber sefault fix none

Description Ozkan Sezer 2012-02-03 10:32:55 UTC
Created attachment 559260 [details]
svgalib vga_getmodenumber sefault fix

Description of problem:

- If a bad name is fed to vga_getmodenumber() a segfault happens

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

- 1.9.25 in any fedora release

How reproducible:

Always

Steps to Reproduce:
1. Try doing a vga_getmodenumber("my_bad_madename")
2.
3.
  
Actual results:

- Segmentation fault

Expected results:

- The library to return -1 and print "Invalid graphics mode 'my_bad_modename'."

Additional info:

- The problem is with vgamodesel.c::vga_getmodenumber() having an insufficient buffersize of 3. Bumping the size to 8 fixes the problem, i.e.:

--- svgalib-1.9.25/src/vgamodesel.c.orig
+++ svgalib-1.9.25/src/vgamodesel.c
@@ -35,7 +35,7 @@ int __svgalib_name2number(char *m)
 int vga_getmodenumber(char *m)
 {
     int i;
-    char s[3];
+    char s[8];
 
     __svgalib_getchipset();		/* Do initialisation first */
     i = __svgalib_name2number(m);

Also attaching a patch in case the text here is mangled.

Comment 1 Fedora End Of Life 2013-01-16 17:05:47 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Ozkan Sezer 2013-01-18 10:25:20 UTC
The bug is in all fedora versions. I changed the version from 16 to 18.

Comment 3 Rakesh Pandit 2013-01-23 01:32:50 UTC
Will have a look at it in a week.

Comment 4 Fedora Admin XMLRPC Client 2013-08-05 18:01:57 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Jaromír Cápík 2013-09-19 17:41:15 UTC
Hello Ozkan.

Thanks for the patch.
I'm building the package with your fix for all currently supported fedora releases.

Once done, please, test and leave some karma, if possible.

Thanks in advance.

Regards,
Jaromir.

Comment 6 Fedora Update System 2013-09-19 18:05:56 UTC
svgalib-1.9.25-14.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/svgalib-1.9.25-14.fc19

Comment 7 Fedora Update System 2013-09-19 18:06:07 UTC
svgalib-1.9.25-14.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/svgalib-1.9.25-14.fc18

Comment 8 Fedora Update System 2013-09-19 18:06:17 UTC
svgalib-1.9.25-14.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/svgalib-1.9.25-14.fc20

Comment 9 Fedora Update System 2013-09-20 16:22:04 UTC
Package svgalib-1.9.25-14.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing svgalib-1.9.25-14.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17192/svgalib-1.9.25-14.fc18
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2013-10-02 06:27:22 UTC
svgalib-1.9.25-14.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2013-10-02 06:28:03 UTC
svgalib-1.9.25-14.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2013-10-02 06:53:22 UTC
svgalib-1.9.25-14.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.