From 5b5f1f3eee71701d67c3ac4cc032c574423a5197 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Thu, 4 Apr 2013 12:11:27 +0200 Subject: [PATCH] Prevent crash due to buffer overflow detection (and on some platforms probably actual buffer overflow). --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 32fdbd0..59240e0 100644 --- a/main.c +++ b/main.c @@ -58,7 +58,7 @@ char **envp; /* * get home and options from environment */ - strncpy(home, md_gethomedir(), PATH_MAX); + strncpy(home, md_gethomedir(), sizeof(home) - 1); strcpy(file_name, home); strcat(file_name, "rogue36.sav"); -- 2.30.2