From 8e9c06627df461e59c21d1086f18f96077c9acd4 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Mon, 16 Jun 2014 20:15:27 +0200 Subject: [PATCH] util: replaced sprintf with snprintf to avoid buffer overflow (Coverity #50220) Signed-off-by: Christophe CURIS --- util/wxcopy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/wxcopy.c b/util/wxcopy.c index 90303fb0..d7e01b6c 100644 --- a/util/wxcopy.c +++ b/util/wxcopy.c @@ -121,7 +121,10 @@ int main(int argc, char **argv) file = fopen(filename, "rb"); if (!file) { char line[1024]; - sprintf(line, "%s: could not open \"%s\"", __progname, filename); + + snprintf(line, sizeof(line), + "%s: could not open \"%s\"", + __progname, filename); perror(line); exit(1); } -- 2.11.4.GIT