From cb8564b17f7767b56f2a57c8c5a064ad86928fad Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 8 Dec 2016 09:33:24 +0100 Subject: [PATCH] Storage: make sure matrix is initialized before read Change-Id: I967ab34c0f0430900b4be4424fa4493386c96c33 --- wsd/Storage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp index 21800aecb..a2ca75bc4 100644 --- a/wsd/Storage.cpp +++ b/wsd/Storage.cpp @@ -283,6 +283,7 @@ Poco::Net::HTTPClientSession* getHTTPClientSession(const Poco::URI& uri) int getLevenshteinDist(const std::string& string1, const std::string& string2) { int matrix[string1.size() + 1][string2.size() + 1]; + std::memset(matrix, 0, sizeof(matrix[0][0]) * (string1.size() + 1) * (string2.size() + 1)); for (size_t i = 0; i < string1.size() + 1; i++) {