From: chanywa Date: Fri, 2 Jun 2017 05:33:12 +0000 (+0900) Subject: Fix svace issue X-Git-Tag: submit/tizen/20170602.053358^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=285af32010e97f9ee5c5efc4a028cc9956726d98;p=platform%2Fcore%2Flocation%2Fmaps-plugin-mapzen.git Fix svace issue Change-Id: Iff8449a760f4a8954a51986b01b2cea2e80266ba --- diff --git a/src/mapzen/mapzen_restcurl.c b/src/mapzen/mapzen_restcurl.c index 05547aa..9fa7e6a 100644 --- a/src/mapzen/mapzen_restcurl.c +++ b/src/mapzen/mapzen_restcurl.c @@ -66,6 +66,7 @@ static void __show_url_log(const char *url) { char urlLog[1024] = {}, *tmp = NULL; int url_index = 0, urlLog_index = 0; + const int bufferSize = sizeof(urlLog); if (!url) return; tmp = strstr(url, "api_key="); @@ -89,7 +90,7 @@ static void __show_url_log(const char *url) } urlLog_index = urlLog_index + 9; } - for (; url_index < strlen(url); url_index++, urlLog_index++) + for (; url_index < strlen(url) && url_index < bufferSize && urlLog_index < bufferSize; url_index++, urlLog_index++) urlLog[urlLog_index] = url[url_index]; MAP_DEBUG("HTTP URL [%s]", urlLog); }