Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211289 - media-libs/libtimidity-0.1.0: overflow-bug in size-calculation causes segfaults (patch included)
Summary: media-libs/libtimidity-0.1.0: overflow-bug in size-calculation causes segfaul...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-24 18:34 UTC by Hendrik Iben
Modified: 2008-02-24 18:43 UTC (History)
0 users

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


Attachments
use unsigned int for size-calculation (libtimidity-0.1.0-newlen-overflow.patch,863 bytes, patch)
2008-02-24 18:35 UTC, Hendrik Iben
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik Iben 2008-02-24 18:34:02 UTC
Some combinations of timidity-patch-sets and MIDI-files lead to ungraceful termination of all programs using the libtimidity-library.
The cause seems to be the use of a signed integer in a sample-size calculation and the overflow of that int. Allocation of sample-memory is not checked, causing a segmentation fault.

The attached patch fixes the problem by using an unsigned int instead. The patch has also been submitted to the librarys project page at sourceforge but the library has not been developed for four years...



Reproducible: Always

Steps to Reproduce:
1. Use a x86-machine (64bit signed int is large enough); select media-sound/timidity-eawpatches-12-r5 as patchset;
2. Playback a MIDI-file (sorry, can't post, copyright...) that triggers the calculation.
Actual Results:  
Application segfaults.

Expected Results:  
Application plays the MIDI-file.
Comment 1 Hendrik Iben 2008-02-24 18:35:02 UTC
Created attachment 144520 [details, diff]
use unsigned int for size-calculation
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2008-02-24 18:43:35 UTC
Thanks