Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 894978 - media-libs/aalib-1.4_rc5: invalid free in case of error
Summary: media-libs/aalib-1.4_rc5: invalid free in case of error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 19:08 UTC by Jocelyn Mayer
Modified: 2023-02-24 16:50 UTC (History)
2 users (show)

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


Attachments
Bugfix: move the (maybeà freed pointer after the possible error case (aalib-1.4.0-invalid_free.patch,496 bytes, patch)
2023-02-16 19:12 UTC, Jocelyn Mayer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2023-02-16 19:08:56 UTC
as upstream repository seems dead, i post the patch there:
in src/aarender.c, function aa_renderpalette, in case of an allocation error, an attempt to free a buffer _after_ the pointer has been moved can be seen in the build logs:
media-libs/aalib-1.4_rc5-r9/work/aalib-1.4.0/src/aarender.c:69:13:
warning: 'free' called on pointer '_15' with nonzero offset 12 [-Wfree-nonheap-object]
A quite obvious fix is to move the pointer after the possible error case.

Reproducible: Always

Steps to Reproduce:
1. Build media-libs/aalib
2. Check the build logs
3.
Actual Results:  
Warning about invalid freed object in src/aarender.c

Expected Results:  
no such warning
Comment 1 Jocelyn Mayer 2023-02-16 19:12:08 UTC
Created attachment 851842 [details, diff]
Bugfix: move the (maybeà freed pointer after the possible error case
Comment 2 Marek Szuba (RETIRED) archtester gentoo-dev 2023-02-24 11:50:52 UTC
I wish all bugs were as easy as this. Thank you for the patch, I'll add it shortly.
Comment 3 Larry the Git Cow gentoo-dev 2023-02-24 16:50:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1fe964780a082775839a682dcbc4b600dc44042

commit d1fe964780a082775839a682dcbc4b600dc44042
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-02-24 12:19:47 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-02-24 16:49:57 +0000

    media-libs/aalib: patch a free-offset-pointer bug
    
    While at it, update EAPI 7 -> 8 and drop IUSE=static-libs.
    
    Thanks-to: Jocelyn Mayer <l_indien@mailmagic.fr>
    Closes: https://bugs.gentoo.org/894978
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 media-libs/aalib/aalib-1.4_rc5-r10.ebuild          | 68 ++++++++++++++++++++++
 .../files/aalib-1.4_rc5-free-offset-pointer.patch  | 14 +++++
 2 files changed, 82 insertions(+)