Bug 153944 - Unsafe mp3 file opening
Summary: Unsafe mp3 file opening
Status: RESOLVED FIXED
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-13 03:14 UTC by Romain Beauxis
Modified: 2008-01-26 21:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test program (504 bytes, text/plain)
2007-12-13 03:15 UTC, Romain Beauxis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Beauxis 2007-12-13 03:14:27 UTC
Version:           1.4 (using KDE KDE 3.5.8)
Installed from:    Debian testing/unstable Packages
OS:                Linux

/* Copied from http://bugs.debian.org/454732 */

        Hi !

As it seems, at least the C binding of the library do not return NULL
when opening a file that exists, but ends with the .mp3 extension..

Output with attached example is:
/nonexistent.mp3: safe file !
/nonexistent: Unsafe file !

The example can be compiled with:
  gcc -o test -ltag_c ./test.c


Romain
Comment 1 Romain Beauxis 2007-12-13 03:15:13 UTC
Created attachment 22517 [details]
Test program
Comment 2 Romain Beauxis 2007-12-13 03:16:50 UTC
I forgot to precise I'm using the C bindings..


Also, as a relative issue, taglib can't detect mp3 when they do not have the mp3 extension, and return NULL... 

It would be nice if the library could autodetect mp3 tags based on the file's content..
Comment 3 Lukáš Lalinský 2007-12-16 22:26:35 UTC
The returned pointer is not unsafe in anyway. You can use it all taglib_file_* calls and taglib_file_tag and taglib_file_audioproperties will return NULL. What's missing is a C wrapper for file->isValid().
Comment 4 Scott Wheeler 2008-01-26 21:21:01 UTC
SVN commit 766868 by wheeler:

Add a C accessor to isValid()

BUG:153944


 M  +5 -0      tag_c.cpp  
 M  +7 -0      tag_c.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=766868