Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 402831

Summary: media-libs/svgalib - vga_getmodenumber() segmentation fault
Product: Gentoo Linux Reporter: O.Sezer <sezeroz>
Component: [OLD] LibraryAssignee: No maintainer - Look at if you want to take care of it <maintainer-needed>
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on: 405411    
Bug Blocks:    
Attachments: vga_getmodenumber buffersize fix

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");
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 <>
  +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: