Mailing List archive

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

[vdr] Re: [PATCH] fix segfaults because of channels with umlauts



Klaus Schmidinger wrote:
> Ludwig Nussel wrote:
> > vdr 1.2.6 segfaults in the "What's on now?" screen if there are
> > channels with Umlauts (e.g. WDR Köln). For some reason asprintf
> > refuses those channels (Invalid or incomplete multibyte or wide
> > character). vdr doesn't evaluate the return value of asprintf and
> > therefore operates on broken (not necessarily NULL) pointers. I have
> > no idea why asprintf suddenly behaves like that, I haven't seen such
> > segfaults before.
> 
> Have you made any changes to your system lately that might have triggered
> this?
> 
> Is this "plain vanilla VDR 1.2.6" or are there any patches involved?

A lot of patches :-) Shouldn't matter, the patches I sent apply to
vanilla as well.

> I don't have any problems here with VDR 1.3.10. Channels with umlauts
> work just fine . This is a SuSE 7.3 system with kernel 2.4.10, in case
> that matters. Maybe you're running a system that uses UTF8 or something
> like that. If so, you could try turning that off.

Yes, of course that's the reason. I didn't see it at first because
LANG=C didn't help but that was because $LC_CTYPE is set explicitely
for root and therefore not overwritten by $LANG.

> > Nevertheless it's a bug in vdr to ignore the
> > return value and to not check for NULL. Attached patch is for 1.2.6,
> > 1.3.x needs a similar one.
> 
> I guess you're right about checking the return value of asprintf().
> But first I'd like to know exactly why asprintf() failed on your system.
> The typical error mentioned in the GNU C Library Reference Manual for
> asprintf() would be a failure to allocate the buffer, which normally
> should be pretty unlikely, given the amount of RAM today's systems have...

LC_CTYPE was set to de_DE.UTF-8 and asprintf apparently fails if it
encounters an invalid UTF-8 string in this case.

> > Does DVB define an encoding for channel names and EPG or do umlauts
> > only work by accident?
> 
> The German channels apparently use the ISO-8859-9 character table, so
                                                  ^1
> umlauts work by default.

As long as there is no field in the data received from the satellite
that indicates the specific encoding I'd call this 'by accident'. I
suppose czech channels have broken umlauts on systems with a german
locale and vice versa.

cu
Ludwig

-- 
(o_  Ludwig.Nussel@gmx.de
//\  PGP Key ID: FF8135CE
V_/_ ICQ:        52166811




Home | Main Index | Thread Index