<html><head></head><body>+1 for an assert<br><br><div class="gmail_quote">Le 18 septembre 2020 10:18:28 GMT+03:00, Alexandre Janniaux <ajanni@videolabs.io> 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">Hi,<br><br>On Thu, Sep 17, 2020 at 09:46:38PM +0100, Lyndon Brown wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">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 #ad7fa8; 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 #8ae234; 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> 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 #ad7fa8; padding-left: 1ex;">The NULs need to be replaced with valid strings.<br></blockquote>Granted, I'll submit the patches to address that. But things should<br>robustly handle this situation rather than crash.<br></blockquote><br>Not sure you can robustly manage to have the plugins fixed,<br>including future usage, while having a defensive approach.<br><br>Instead, enforcing with an assert might help spotting the<br>place where it's not respected.<br><br>Regards,<br>--<br>Alexandre Janniaux<br>Videolabs<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>