<html><head></head><body>Hi,<br><br>The point is that the warning points to a real problem with the implementation, which the patch does not fix. And as a general rule, I'm against removing warnings without fixing the real problem.<br><br><div class="gmail_quote">Le 20 janvier 2020 15:51:03 GMT+02: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>There should be no functional differences as the null character is<br>forced in the end of the path. Copying one meaningful character less<br>would happend as soon as the path is already too long, and otherwise<br>only the strncpy null character is expected to be truncated, but is<br>ensured by the code following.<br><br>The documentation state that sun_path should contain a null-terminated<br>pathname so it doesn't look wrong to enforce the last \0 byte too. Am<br>I missing something?<br><br>I hope I'm clear enough,<br><br>Regards,<br>--<br>Alexandre Janniaux<br>Videolabs<br><br>On Mon, Jan 20, 2020 at 03:29:43PM +0200, 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;"> On second consideration, chopping the path is not correct behaviour. This patch is concealing the bug highlighted by the warning rather than fixing it IMO.<br><br> Better drop the feature altogether as I dot think anyone's using it.<br><br> Le 20 janvier 2020 09:38:46 GMT+02:00, "Rémi Denis-Courmont" <remi@remlab.net> a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">OK, though I'd suggest removing Unix socket support entirely as the old<br>RC "protocol" is not suitable for programmatic usage.<br><br>Le 19 janvier 2020 17:39:27 GMT+02:00, Alexandre Janniaux<br><ajanni@videolabs.io> a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">Fortify enabled implies a warning if we use strncpy with a length<br></blockquote>equal<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">to the buffer size. As we fill the last item with a null character, we<br>can use length-1 instead as well.<hr> modules/control/rc.c | 2 +-<br> 1 file changed, 1 insertion(+), 1 deletion(-)<br><br>diff --git a/modules/control/rc.c b/modules/control/rc.c<br>index cd85602d59..dc37d352ad 100644<br>--- a/modules/control/rc.c<br>+++ b/modules/control/rc.c<br>@@ -1730,7 +1730,7 @@ static int Activate( vlc_object_t *p_this )<br> }<br><br> addr.sun_family = AF_LOCAL;<br>- strncpy( addr.sun_path, psz_unix_path, sizeof( addr.sun_path<br></blockquote>)<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">);<br>+ strncpy( addr.sun_path, psz_unix_path, sizeof( addr.sun_path<br></blockquote>)<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">- 1 );<br> addr.sun_path[sizeof( addr.sun_path ) - 1] = '\0';<br><br> if (bind (i_socket, (struct sockaddr *)&addr, sizeof (addr))<br>--<br>2.25.0<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><br></blockquote>--<br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser<br>ma brièveté.<br></blockquote>--<br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.<br></blockquote><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><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><br></blockquote><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>