jorton Thu Jan 6 05:21:09 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src NEWS
/php-src/ext/curl interface.c
Log:
MFH: - Fixed bug #31413 (curl POSTFIELDS crashes on 64-bit platforms).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.178&r2=1.1760.2.179&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.178 php-src/NEWS:1.1760.2.179
--- php-src/NEWS:1.1760.2.178 Tue Jan 4 02:41:07 2005
+++ php-src/NEWS Thu Jan 6 05:21:07 2005
@@ -4,6 +4,7 @@
- Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
- Added length and charsetnr for field array and object in mysqli. (Georg)
- Fixed a bug in mysqli_stmt_execute() (type conversion with NULL values).
(Georg)
+- Fixed bug #31413 (curl POSTFIELDS crashes on 64-bit platforms). (Joe)
- Fixed bug #31396 (compile fails with gd 2.0.33 without freetype). (Jani)
- Fixed bug #31371 (highlight_file() trims new line after heredoc). (Ilia)
- Fixed bug #31361 (simplexml/domxml segfault when adding node twice). (Rob)
http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.46.2.5&r2=1.46.2.6&ty=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.46.2.5
php-src/ext/curl/interface.c:1.46.2.6
--- php-src/ext/curl/interface.c:1.46.2.5 Sun Oct 31 23:52:51 2004
+++ php-src/ext/curl/interface.c Thu Jan 6 05:21:09 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interface.c,v 1.46.2.5 2004/11/01 04:52:51 iliaa Exp $ */
+/* $Id: interface.c,v 1.46.2.6 2005/01/06 10:21:09 jorton Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -1086,18 +1086,22 @@
zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len,
&num_key, 0, NULL);
postval = Z_STRVAL_PP(current);
+
+ /* The arguments after _NAMELENGTH and
_CONTENTSLENGTH
+ * must be explicitly cast to long in
curl_formadd
+ * use since curl needs a long not an
int. */
if (*postval == '@') {
error = curl_formadd(&first,
&last,
CURLFORM_COPYNAME, string_key,
-
CURLFORM_NAMELENGTH, string_key_len - 1,
+
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
CURLFORM_FILE, ++postval,
CURLFORM_END);
} else {
error = curl_formadd(&first,
&last,
CURLFORM_COPYNAME, string_key,
-
CURLFORM_NAMELENGTH, string_key_len - 1,
+
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
CURLFORM_COPYCONTENTS, postval,
-
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
+
CURLFORM_CONTENTSLENGTH, (long)Z_STRLEN_PP(current),
CURLFORM_END);
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php