1. Fixed TDIS-5293 2.1b_release accepted/tizen_2.1/20130423.151656 submit/tizen_2.1/20130423.102631
authorGangHeok Kim <gangheok.kim@samsung.com>
Thu, 18 Apr 2013 12:30:43 +0000 (21:30 +0900)
committerGangHeok Kim <gangheok.kim@samsung.com>
Thu, 18 Apr 2013 12:30:43 +0000 (21:30 +0900)
  - The buffer overflow flaw was fixed. (CVE-2013-0249)
  - strcpy() was changed to snprintf()

Change-Id: I7702671be46e241d89b2a6752fc2868e43114242

packaging/curl.spec
packaging/tizen_fix_buffer_overflow.patch [new file with mode: 0644]

index 6d48022..229d7f2 100644 (file)
@@ -8,6 +8,8 @@ License:    MIT
 #Source0:    http://curl.haxx.se/download/%{name}-%{version}.tar.bz2
 Source0:    %{name}-%{version}.tar.gz
 
+Patch01: tizen_fix_buffer_overflow.patch
+
 BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(libidn)
 BuildRequires:  pkgconfig(zlib)
@@ -54,6 +56,7 @@ use cURL's capabilities internally.
 %prep
 %setup -q
 
+%patch01 -p1
 
 %build
 
diff --git a/packaging/tizen_fix_buffer_overflow.patch b/packaging/tizen_fix_buffer_overflow.patch
new file mode 100644 (file)
index 0000000..1b636f1
--- /dev/null
@@ -0,0 +1,39 @@
+--- 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);