From 67bfe6bb36c76ecb1b5533c2f915b561a22c1bbd Mon Sep 17 00:00:00 2001 From: Arkshine Date: Fri, 1 Aug 2014 12:59:56 +0200 Subject: [PATCH] Geoip: Fix possible buffer overflow. --- dlls/geoip/geoip_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/geoip/geoip_util.cpp b/dlls/geoip/geoip_util.cpp index 41a8de4a..4c675905 100644 --- a/dlls/geoip/geoip_util.cpp +++ b/dlls/geoip/geoip_util.cpp @@ -102,7 +102,7 @@ const char *lookupString(const char *ip, const char **path, int *length) } // Let's avoid a crash in case we go over the buffer size. - size_t maxLength = ke::Min((size_t)result.data_size, sizeof(buffer)); + size_t maxLength = ke::Min((size_t)result.data_size, sizeof(buffer)-1); // Strings from database are not null terminated. memcpy(buffer, result.utf8_string, maxLength);