Date: Sat, 8 Jul 2017 04:30:12 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320799 - stable/11/libexec/rtld-elf Message-ID: <201707080430.v684UCgL090875@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Sat Jul 8 04:30:11 2017 New Revision: 320799 URL: https://svnweb.freebsd.org/changeset/base/320799 Log: MFC r320665: In open_binary_fd: when using buffer size for strl* and snprintf, always use >= instead of > to avoid truncation. releng/11.1 candidate. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sat Jul 8 02:02:49 2017 (r320798) +++ stable/11/libexec/rtld-elf/rtld.c Sat Jul 8 04:30:11 2017 (r320799) @@ -5295,14 +5295,14 @@ open_binary_fd(const char *argv0, bool search_in_path) fd = -1; errno = ENOENT; while ((pe = strsep(&pathenv, ":")) != NULL) { - if (strlcpy(binpath, pe, sizeof(binpath)) > + if (strlcpy(binpath, pe, sizeof(binpath)) >= sizeof(binpath)) continue; if (binpath[0] != '\0' && - strlcat(binpath, "/", sizeof(binpath)) > + strlcat(binpath, "/", sizeof(binpath)) >= sizeof(binpath)) continue; - if (strlcat(binpath, argv0, sizeof(binpath)) > + if (strlcat(binpath, argv0, sizeof(binpath)) >= sizeof(binpath)) continue; fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707080430.v684UCgL090875>