From 4892976d90c77c7d8ccc4cf2e33ee570bda0cae8 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 28 Oct 2015 11:15:21 +0100 Subject: [PATCH] use safe_strcat() to prevent buffer overflow fixes CID 27828 found by Coverity --- sched/sched_util_basic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sched/sched_util_basic.cpp b/sched/sched_util_basic.cpp index 5c721d2592..2e903ee36f 100644 --- a/sched/sched_util_basic.cpp +++ b/sched/sched_util_basic.cpp @@ -30,6 +30,7 @@ #include "filesys.h" #include "md5_file.h" #include "util.h" +#include "str_replace.h" #include "sched_config.h" #include "sched_msgs.h" @@ -241,7 +242,7 @@ int mylockf(int fd) { bool is_arg(const char* x, const char* y) { char buf[256]; strcpy(buf, "--"); - strcat(buf, y); + safe_strcat(buf, y); if (!strcmp(buf, x)) return true; if (!strcmp(buf+1, x)) return true; return false;