Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 402831 - media-libs/svgalib - vga_getmodenumber() segmentation fault
Summary: media-libs/svgalib - vga_getmodenumber() segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on: 405411
Blocks:
  Show dependency tree
 
Reported: 2012-02-09 09:50 UTC by O.Sezer
Modified: 2012-03-03 12:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
vga_getmodenumber buffersize fix (vga_getmodenumber.patch,302 bytes, patch)
2012-02-09 09:51 UTC, O.Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O.Sezer 2012-02-09 09:50:24 UTC
If a bad name is fed to vga_getmodenumber() a segfault happens.

Reproducible: Always

Steps to Reproduce:
1. Try doing a vga_getmodenumber("my_bad_modename");
2.
3.
Actual Results:  
Segmentation fault

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

The problem is with vgamodesel.c::vga_getmodenumber() having an insufficient buffersize of 3. Bumping the size to 8 fixes the problem. A patch is attached.
Comment 1 O.Sezer 2012-02-09 09:51:44 UTC
Created attachment 301365 [details, diff]
vga_getmodenumber buffersize fix
Comment 2 Pacho Ramos gentoo-dev 2012-02-23 11:37:37 UTC
Please go to bug 405411 and check its ebuild
Comment 3 Pacho Ramos gentoo-dev 2012-03-03 12:37:46 UTC
*svgalib-1.9.25-r2 (03 Mar 2012)

  03 Mar 2012; Pacho Ramos <pacho@gentoo.org>
  +files/svgalib-1.9.25-build2.patch,                                     
  +files/svgalib-1.9.25-fPIC.patch, +files/svgalib-1.9.25-linux2.6.36-r1.patch,
  +files/svgalib-1.9.25-segfault.patch, +svgalib-1.9.25-r2.ebuild:
  Respect LDFLAGS (bug #339873 by Andrew Savchenko), install svgalib_helper.h
  (bug #341393 by Andrew Savchenko), fix build with recent kernels (bug #344663
  by Rene Hertell), fix segfault (bug #402831 by O.Sezer).

Anyway, this package needs a maintainer to get things fixed sooner. I can be your proxy maintainer if you want:
http://www.gentoo.org/proj/en/qa/proxy-maintainers/index.xml