opendoas

my fork of doas with custom prompt
git clone git://git.kocotian.pl/opendoas.git
Log | Files | Refs | README | LICENSE

commit 365f92247952a8be6d8e40b6770589dbe169825c
parent 612315084e72327418904d204b709a1db543ece8
Author: Duncaen <mail@duncano.de>
Date:   Wed, 30 Jan 2019 21:06:15 +0100

libopenbsd/closefrom: correctly handle snprintf truncation

Diffstat:
Mlibopenbsd/closefrom.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libopenbsd/closefrom.c b/libopenbsd/closefrom.c @@ -77,7 +77,7 @@ closefrom(int lowfd) /* Check for a /proc/$$/fd directory. */ len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid()); - if (len > 0 && (size_t)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) { + if (len > 0 && (size_t)len < sizeof(fdpath) && (dirp = opendir(fdpath))) { while ((dent = readdir(dirp)) != NULL) { fd = strtol(dent->d_name, &endp, 10); if (dent->d_name != endp && *endp == '\0' &&