diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2019-03-12 10:47:17 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2019-03-12 10:47:17 +0000 |
commit | 4cb6aeea05b8136d01721f89b6cffbd43b9f1afc (patch) | |
tree | 14ead89479c36d9b7d81de1651ad761bdde2adb6 | |
parent | 69a207f3603c64a1402fb8478b49d61afb8dae55 (diff) |
initialize and zero terminate temp buffer
-rw-r--r-- | configd/src/apps/sentinel/config-handler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/configd/src/apps/sentinel/config-handler.cpp b/configd/src/apps/sentinel/config-handler.cpp index a62b74c6b4a..486c46e7442 100644 --- a/configd/src/apps/sentinel/config-handler.cpp +++ b/configd/src/apps/sentinel/config-handler.cpp @@ -384,6 +384,7 @@ ConfigHandler::handleCmd(const Cmd& cmd) char retbuf[65536]; size_t left = 65536; size_t pos = 0; + retbuf[pos] = 0; for (ServiceMap::iterator it(_services.begin()), mt(_services.end()); it != mt; it++) { Service *service = it->second.get(); const SentinelConfig::Service& config = service->serviceConfig(); @@ -397,6 +398,7 @@ ConfigHandler::handleCmd(const Cmd& cmd) left -= sz; if (left <= 0) break; } + retbuf[65535] = 0; cmd.retValue(retbuf); } break; |