From 6cd8facf493b1ddc493d3a1d59da2b8a9f3a1da4 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 14 Jan 2016 12:30:59 -0500 Subject: [PATCH] Memset filename to zero first --- CLTool/src/compare.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/CLTool/src/compare.cpp b/CLTool/src/compare.cpp index 555364c..f5d9670 100644 --- a/CLTool/src/compare.cpp +++ b/CLTool/src/compare.cpp @@ -127,6 +127,7 @@ int main(int argc, char **argv) { FasTC::Image<> diff = img1.Diff(&img2, diff_multiplier); char fname_buf [5 + 16 + 4 + 1]; // "diff-" + hash + ".png" + null + memset(fname_buf, 0, sizeof(fname_buf)); strncat(fname_buf, "diff-", 5); gen_random(fname_buf + 5, 16); strncat(fname_buf + 5 + 16, ".png", 4);