From 31b20bb2fb2e19835dfb38845ccc7faa64dba658 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Sat, 30 Apr 2016 11:50:52 +0200 Subject: [PATCH] Fix size of allocated memory in xbus strdup --- src/xbus/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xbus/utils.h b/src/xbus/utils.h index 0bd593172..2a213dc97 100644 --- a/src/xbus/utils.h +++ b/src/xbus/utils.h @@ -94,7 +94,7 @@ class QSharedApplication : public QApplication m_weakptr = ptr; } - static char *strdup(const char *s) { auto s2 = static_cast(std::malloc(std::strlen(s))); return std::strcpy(s2, s); } + static char *strdup(const char *s) { auto s2 = static_cast(std::malloc(std::strlen(s) + 1)); return std::strcpy(s2, s); } public: /*!