Date: Sun, 28 Jan 2018 03:16:54 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328506 - head/contrib/opie/libopie Message-ID: <201801280316.w0S3Gs2s007336@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Sun Jan 28 03:16:54 2018 New Revision: 328506 URL: https://svnweb.freebsd.org/changeset/base/328506 Log: Revert r328492: "Fix gcc80 -Wsizeof-pointer-memaccess warning." The warning is bogus: GCC8 only looks at the size of the destination. We shouldn't be fixing imaginary problems, so perhaps its better to deal with this later on by disabling such warnings. Pointed out by: ed, bde Modified: head/contrib/opie/libopie/insecure.c Modified: head/contrib/opie/libopie/insecure.c ============================================================================== --- head/contrib/opie/libopie/insecure.c Sun Jan 28 03:07:22 2018 (r328505) +++ head/contrib/opie/libopie/insecure.c Sun Jan 28 03:16:54 2018 (r328506) @@ -135,7 +135,8 @@ int opieinsecure FUNCTION_NOARGS char host[sizeof(utmp.ut_host) + 1]; insecure = 1; - strncpy(host, utmp.ut_host, sizeof(host)); + strncpy(host, utmp.ut_host, sizeof(utmp.ut_host)); + host[sizeof(utmp.ut_host)] = 0; if (s = strchr(host, ':')) { int n = s - host;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801280316.w0S3Gs2s007336>
