From d280db48be45c54906dbaf3bed811b61193e8d5f Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 21 Oct 2015 15:47:32 +0200 Subject: [PATCH] use snprintf to prevent buffer overflow fixes CID 27964 found by Coverity --- sched/adjust_user_priority.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/adjust_user_priority.cpp b/sched/adjust_user_priority.cpp index bf99fdbd18..9ae3fe0129 100644 --- a/sched/adjust_user_priority.cpp +++ b/sched/adjust_user_priority.cpp @@ -80,7 +80,7 @@ int main(int argc, char** argv) { } DB_APP app; - sprintf(buf, "where name='%s'", app_name); + snprintf(buf, sizeof(buf), "where name='%s'", app_name); retval = app.lookup(buf); if (retval) { fprintf(stderr, "no such app %s\n", argv[3]);