From 52f494ef98a0aeaa13bf7e419024efece646a4d9 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 21 Oct 2015 17:30:58 +0200 Subject: [PATCH] use snprintf to prevent buffer overflow fixes CID 27968 found by Coverity --- vda/vda.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vda/vda.cpp b/vda/vda.cpp index a5e02e0dfc..b47cec8140 100644 --- a/vda/vda.cpp +++ b/vda/vda.cpp @@ -223,7 +223,7 @@ int handle_status(const char* name) { int handle_update(const char* name) { DB_VDA_FILE dvf; char buf[1024]; - sprintf(buf, "where file_name='%s'", name); + snprintf(buf, sizeof(buf), "where file_name='%s'", name); int retval = dvf.lookup(buf); if (retval) return retval; return dvf.update_field("need_update=1");