--- /dev/null
+--- curl.org/lib/curl_sasl.c 2013-04-17 17:36:08.580936869 +0900
++++ curl/lib/curl_sasl.c 2013-04-18 20:57:50.000000000 +0900
+@@ -345,9 +345,7 @@
+ snprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]);
+
+ /* Prepare the URL string */
+- strcpy(uri, service);
+- strcat(uri, "/");
+- strcat(uri, realm);
++ snprintf(uri, sizeof(uri), "%s/%s", service, realm);
+
+ /* Calculate H(A2) */
+ ctxt = Curl_MD5_init(Curl_DIGEST_MD5);
+@@ -391,20 +389,11 @@
+ for(i = 0; i < MD5_DIGEST_LEN; i++)
+ snprintf(&resp_hash_hex[2 * i], 3, "%02x", digest[i]);
+
+- strcpy(response, "username=\"");
+- strcat(response, userp);
+- strcat(response, "\",realm=\"");
+- strcat(response, realm);
+- strcat(response, "\",nonce=\"");
+- strcat(response, nonce);
+- strcat(response, "\",cnonce=\"");
+- strcat(response, cnonce);
+- strcat(response, "\",nc=");
+- strcat(response, nonceCount);
+- strcat(response, ",digest-uri=\"");
+- strcat(response, uri);
+- strcat(response, "\",response=");
+- strcat(response, resp_hash_hex);
++ snprintf(response, sizeof(response),
++ "username=\"%s\",realm=\"%s\",nonce=\"%s\","
++ "cnonce=\"%s\",nc=\"%s\",digest-uri=\"%s\",response=%s",
++ userp, realm, nonce,
++ cnonce, nonceCount, uri, resp_hash_hex);
+
+ /* Base64 encode the reply */
+ return Curl_base64_encode(data, response, 0, outptr, outlen);