[vlc-devel] [PATCH] fix null deref crash

Rémi Denis-Courmont remi at remlab.net
Fri Sep 18 09:43:27 CEST 2020


Hi,

There are issues in deviating. Practically, it defeats the existing test case that looks out for that exact bug class, at least in the help texts. Also obviously it won't work if the wrapper is not called because NLS is not enabled.

So what if fromUtf8() can handle NULLs? There are plenty of other code paths that get a translated string besides that Qt helper function.

Le 17 septembre 2020 23:46:38 GMT+03:00, Lyndon Brown <jnqnfe at gmail.com> a écrit :
>On Thu, 2020-09-17 at 22:45 +0300, Rémi Denis-Courmont wrote:
>> Le torstaina 17. syyskuuta 2020, 22.34.37 EEST Lyndon Brown a écrit :
>> > a few plugins have recently introduced options with no shorttext,
>> > resulting in a null dereference crash when their respective entries
>> > are
>> > selected in the Qt advances prefs tree.
>> 
>> Passing NULL for a translated string is not defined. The approach in
>> your patch 
>> is not an adequate solution, because it cannot prevent the NULL
>> dereference 
>> when NLS is disabled.
>
>Not defined? This concerns the VLC wrappers, not the actual gettext
>functions... Also, if it's UB, then there's no issue deviating, if
>indeed we are...
>
>With the fix in place, a NULL pointer passed into the wrapper is simply
>returned, which is the same as when ENABLE_NLS is not defined.
>
>I've tried the fix, and it works, thus the caller (Qt module code in
>this case) is clearly able to handle the NULL perfectly fine when
>returned for input to QString::fromUtf8(). I don't see any need to
>modify the Qt module (or others if they also cope fine) to handle a
>null in any special way.
>
>I'm afraid  don't see why the fix would be inadequate...
>
>> The NULs need to be replaced with valid strings.
>
>Granted, I'll submit the patches to address that. But things should
>robustly handle this situation rather than crash.
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200918/2d5d1756/attachment.html>


More information about the vlc-devel mailing list