Re: [Tracker] PATCH: Fix segfault in mp3 extractor when missing the CP1252 code page



On 12/07/13 11:59, Jonatan Pålsson wrote:
Hi list,

Hello Jonatan,

I have two more patches which may be of interest. I will submit them
in separate emails to keep the discussion threads separate.

First off, I noticed an issue in the mp3 extractor when running on a
system with very few code pages installed. It seems that g_convert
does not set an error when a code page is missing, instead it simply
does not convert any bytes. In the function called
"convert_to_encoding" of tracker-extract-mp3.c (for quick reference,
see here: 
https://github.com/Pelagicore/tracker-ivi/blob/mainline_compat/src/tracker-extract/tracker-extract-mp3.c#L693),
this means we may return NULL to id3v2_text_to_utf8 and
id3v24_text_to_utf8 - and pass NULL along from these function as well.

This patch guards the return values of these last two functions from
NULLs when parsing tags. If a null is encountered, the tag can't be
parsed and parsing is skipped.

The old behavior led to a segmentation fault on my machine. To

reproduce the segmentation fault, you could either uninstall the
CP1252 code page, or try returning NULL from these functions.

Thanks for the reproduction instructions.

Patch is here: https://github.com/Pelagicore/tracker-ivi/commit/0f3236f2180d77d1e56a02717ecec95675fd1c5d

Thanks for the patch :)

Applied to master now, will be in 0.16.2 when I get to it.

--
Regards,
Martyn

Founder and CEO of Lanedo GmbH.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]