Fix svace issue 80/132280/1 accepted/tizen/unified/20170602.054032 submit/tizen/20170602.053358
authorchanywa <cbible.kim@samsung.com>
Fri, 2 Jun 2017 05:33:12 +0000 (14:33 +0900)
committerchanywa <cbible.kim@samsung.com>
Fri, 2 Jun 2017 05:33:12 +0000 (14:33 +0900)
Change-Id: Iff8449a760f4a8954a51986b01b2cea2e80266ba

src/mapzen/mapzen_restcurl.c

index 05547aa..9fa7e6a 100644 (file)
@@ -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);
 }