Imported Upstream version 7.50.2
[platform/upstream/curl.git] / tests / libtest / lib1510.c
index 3d791e0..25e9fed 100644 (file)
@@ -44,7 +44,8 @@ int test(char *URL)
 
   /* Create fake DNS entries for serverX.example.com for all handles */
   for(i=0; i < NUM_URLS; i++) {
-    sprintf(dnsentry, "server%d.example.com:%s:%s", i + 1, port, address);
+    snprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", i + 1,
+             port, address);
     printf("%s\n", dnsentry);
     slist2 = curl_slist_append(slist, dnsentry);
     if(!slist2) {
@@ -73,8 +74,9 @@ int test(char *URL)
   /* get NUM_HANDLES easy handles */
   for(i=0; i < NUM_URLS; i++) {
     /* specify target */
-    sprintf(target_url, "http://server%d.example.com:%s/path/1510%04i",
-            i + 1, port, i + 1);
+    snprintf(target_url, sizeof(target_url),
+             "http://server%d.example.com:%s/path/1510%04i",
+             i + 1, port, i + 1);
     target_url[sizeof(target_url) - 1] = '\0';
     easy_setopt(curl, CURLOPT_URL, target_url);