From de41f9854ec827c5cfe89cc44c644e4c38a6faa0 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Tue, 12 Jan 2016 18:49:43 +0100 Subject: Use PATH_MAX for buffers holding paths --- src/main.c | 2 +- src/navigator.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 25ffce1..f3c197b 100644 --- a/src/main.c +++ b/src/main.c @@ -217,7 +217,7 @@ int main(int argc, char** argv) /* if the user asked us to load paths from stdin, now is the time */ if(g_options.sin) { - char buf[512]; + char buf[PATH_MAX]; while(fgets(buf, sizeof(buf), stdin)) { size_t len = strlen(buf); if(buf[len-1] == '\n') { diff --git a/src/navigator.c b/src/navigator.c index fb2a3cd..dd5124d 100644 --- a/src/navigator.c +++ b/src/navigator.c @@ -17,6 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "navigator.h" +#include #include #include #include @@ -84,7 +85,7 @@ static void add_item(struct imv_navigator *nav, const char *path, void imv_navigator_add(struct imv_navigator *nav, const char *path, int recursive) { - char path_buf[512]; + char path_buf[PATH_MAX]; struct stat path_info; stat(path, &path_info); if(S_ISDIR(path_info.st_mode)) { -- cgit v1.2.3