From e2508a0d361aed6fdbf59e6ef7c31b1d81b123bb Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 21 Oct 2015 17:01:12 +0200 Subject: [PATCH] use snprintf to prevent buffer overflow fixes CID 27939 found by Coverity --- tools/cancel_jobs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cancel_jobs.cpp b/tools/cancel_jobs.cpp index fe401df7f4..360ea56b31 100644 --- a/tools/cancel_jobs.cpp +++ b/tools/cancel_jobs.cpp @@ -47,7 +47,7 @@ int main(int argc, char** argv) { if (!strcmp(argv[1], "--name")) { DB_WORKUNIT wu; char buf[256]; - sprintf(buf, "where name='%s'", argv[2]); + snprintf(buf, sizeof(buf), "where name='%s'", argv[2]); retval = wu.lookup(buf); if (retval) { fprintf(stderr, "No workunit named '%s'\n", argv[2]);