Dirty pointer in TagLib::FLAC::FilePrivate::tag might lead to crash if no FLAC tags are read

Diego 'Flameeyes' Pettenò flameeyes at gentoo.org
Sat May 13 19:43:48 CEST 2006


The subject pretty much summaries the problem :)

The tag member of TagLib::FLAC::FilePrivate is not initialised, so it might 
lead to crashes when no tags are read from a FLAC file, as its de-referencing 
will point to nobody knows what (but doesn't return NULL).

The attached patch solves the issue, by initialising tag to 0, so that at 
least it's NULL-ified.

I found this problem while working on my TagLib bindings for ruby (RubyTag++, 
at http://dev.gentoo.org/~flameeyes/bzr/rubytag++-2/ ), as gcc 3.4 crashed in 
a dynamic_cast when trying to return the right pointer. On gcc 4 the problem 
is not present if one uses dynamic_cast, as if the pointer is dirty, 
dynamic_cast returns 0.

Now, if only I could find why it doesn't read the data out of the FLAC file I 
would be happy :)

-- 
Diego "Flameeyes" Pettenò - http://farragut.flameeyes.is-a-geek.org/
Gentoo/Alt lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: taglib-1.4-dirtypointer.patch
Type: text/x-diff
Size: 411 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/taglib-devel/attachments/20060513/ffeac003/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/taglib-devel/attachments/20060513/ffeac003/attachment.pgp 


More information about the taglib-devel mailing list