From 54340c464d11b9840a8ef48c6bb46f2b2650b90a Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Mon, 8 Jul 2019 22:12:13 +0200 Subject: [PATCH] termio: fix CID1402874, buffer overrun Also fix CID1402875, CID1402876, CID1402877, CID1402878 --- src/bin/termio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/termio.c b/src/bin/termio.c index c4337ce1..247ab7cd 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -361,7 +361,8 @@ termio_cwd_get(const Evas_Object *obj, char *buf, size_t size) ssize_t siz; snprintf(procpath, sizeof(procpath), "/proc/%ld/cwd", (long) pid); - if ((siz = readlink(procpath, buf, size)) < 1) + siz = readlink(procpath, buf, size); + if ((siz == -1) || (siz >= (ssize_t)size)) { ERR(_("Could not load working directory %s: %s"), procpath, strerror(errno));