Module: check_mk
Branch: master
Commit: 1f40978d20fb3c05d5e6f92f6e8798c869c8827d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1f40978d20fb3c…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Feb 2 16:02:17 2016 +0100
clang-tidy fixes for clang-analyzer-security.insecureAPI.strcpy check.
---
livestatus/src/OutputBuffer.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/OutputBuffer.cc b/livestatus/src/OutputBuffer.cc
index 9e605f1..261e4d1 100644
--- a/livestatus/src/OutputBuffer.cc
+++ b/livestatus/src/OutputBuffer.cc
@@ -36,6 +36,8 @@
#include "Query.h"
#include "logger.h"
+using std::string;
+
#define WRITE_TIMEOUT_USEC 100000
OutputBuffer::OutputBuffer() : _max_size(INITIAL_OUTPUT_BUFFER_SIZE) {
@@ -146,9 +148,8 @@ void OutputBuffer::setError(unsigned code, const char *format, ...) {
va_start(ap, format);
vsnprintf(buffer, sizeof(buffer) - 1, format, ap);
logger(LG_INFO, "error: %s", buffer);
- strcat(buffer, "\n");
va_end(ap);
- _error_message = buffer;
+ _error_message = string(buffer) + "\n";
_response_code = code;
}
}