From: Alan Cox Date: Thu, 21 May 2015 22:34:59 +0000 (+0100) Subject: ls: fix buffer length checks X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=c6e3f12238fbe80f8192635e1e81a04f1a157513;p=FUZIX.git ls: fix buffer length checks --- diff --git a/Applications/util/ls.c b/Applications/util/ls.c index 97da0a06..225f2eeb 100644 --- a/Applications/util/ls.c +++ b/Applications/util/ls.c @@ -295,9 +295,9 @@ void main(int argc, char *argv[]) if ((*name != '.') || (name[1] != '\0')) { strcpy(fullname, name); if (!endslash) - strcat(fullname, "/"); + strlcat(fullname, "/", sizeof(fullname)); } - strcat(fullname, dp->d_name); + strlcat(fullname, dp->d_name, sizeof(fullname)); if (listused >= listsize) { newlist = realloc(list, ((sizeof(char **)) * (listsize + LISTSIZE)));