<html><head></head><body>Hi,<br><br>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.<br><br>So what if fromUtf8() can handle NULLs? There are plenty of other code paths that get a translated string besides that Qt helper function.<br><br><div class="gmail_quote">Le 17 septembre 2020 23:46:38 GMT+03:00, Lyndon Brown <jnqnfe@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Thu, 2020-09-17 at 22:45 +0300, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le torstaina 17. syyskuuta 2020, 22.34.37 EEST Lyndon Brown a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">a few plugins have recently introduced options with no shorttext,<br>resulting in a null dereference crash when their respective entries<br>are<br>selected in the Qt advances prefs tree.<br></blockquote>Passing NULL for a translated string is not defined. The approach in<br>your patch <br>is not an adequate solution, because it cannot prevent the NULL<br>dereference <br>when NLS is disabled.<br></blockquote><br>Not defined? This concerns the VLC wrappers, not the actual gettext<br>functions... Also, if it's UB, then there's no issue deviating, if<br>indeed we are...<br><br>With the fix in place, a NULL pointer passed into the wrapper is simply<br>returned, which is the same as when ENABLE_NLS is not defined.<br><br>I've tried the fix, and it works, thus the caller (Qt module code in<br>this case) is clearly able to handle the NULL perfectly fine when<br>returned for input to QString::fromUtf8(). I don't see any need to<br>modify the Qt module (or others if they also cope fine) to handle a<br>null in any special way.<br><br>I'm afraid don't see why the fix would be inadequate...<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">The NULs need to be replaced with valid strings.<br></blockquote><br>Granted, I'll submit the patches to address that. But things should<br>robustly handle this situation rather than crash.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>