From ebfb7652b0f5e36dbf6aa046dec0bcd1f900e807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Koci=C4=87?= Date: Sat, 18 Jun 2016 22:53:49 +0200 Subject: [PATCH] Fix overlap of source and destination buffers in snprintf call --- command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command.c b/command.c index c4ed23915b..689dc9c0c7 100644 --- a/command.c +++ b/command.c @@ -1586,7 +1586,7 @@ static void command_event_save_state(const char *path, strlcpy(buf, path, sizeof(buf)); snprintf(buf, sizeof(buf), "%s", path); path_remove_extension(buf); - snprintf(buf, sizeof(buf), "%s.last", buf); + strlcat(buf, ".last", sizeof(buf)); if (!content_rename_state(path, buf)) {