iliaa Mon Oct 18 18:43:29 2004 EDT
Modified files: (Branch: PHP_4_3)
/php-src NEWS
/php-src/ext/curl curl.c
Log:
MFH: Fixed bug #30475 (curl_getinfo() may crash in some situations).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.741&r2=1.1247.2.742&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.741 php-src/NEWS:1.1247.2.742
--- php-src/NEWS:1.1247.2.741 Mon Oct 18 11:16:21 2004
+++ php-src/NEWS Mon Oct 18 18:43:29 2004
@@ -4,6 +4,7 @@
- Fixed a bug in addslashes() handling of the '\0' character. (Ilia)
- Backported Marcus' foreach() speedup patch from PHP 5.x. (Derick)
- Fixed potential problems with unserializing invalid serialize data. (Marcus)
+- Fixed bug #30475 (curl_getinfo() may crash in some situations). (Ilia)
- Fixed bug #30442 (segfault when parsing ?getvariable[][ ). (Tony)
- Fixed bug #30282 (segfault when using unknown/unsupported
session.save_handler and/or session.serialize_handler). (Tony)
@@ -14,7 +15,7 @@
(Ilia)
- Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez)
- Fixed bug #30027 (Possible crash inside ftp_get()).
- (cfield at affinitysolutions dot com
+ (cfield at affinitysolutions dot com)
- Fixed bug #29805 (HTTP Authentication Issues). (Uwe Schindler)
- Fixed bug #28325 (Circular references not properly serialised). (Moriyoshi)
- Fixed bug #27469 (serialize() objects of incomplete class). (Dmitry)
http://cvs.php.net/diff.php/php-src/ext/curl/curl.c?r1=1.124.2.25&r2=1.124.2.26&ty=u
Index: php-src/ext/curl/curl.c
diff -u php-src/ext/curl/curl.c:1.124.2.25 php-src/ext/curl/curl.c:1.124.2.26
--- php-src/ext/curl/curl.c:1.124.2.25 Fri Aug 20 09:52:15 2004
+++ php-src/ext/curl/curl.c Mon Oct 18 18:43:29 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: curl.c,v 1.124.2.25 2004/08/20 13:52:15 iliaa Exp $ */
+/* $Id: curl.c,v 1.124.2.26 2004/10/18 22:43:29 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1207,10 +1207,13 @@
switch (option) {
case CURLINFO_EFFECTIVE_URL:
case CURLINFO_CONTENT_TYPE: {
- char *s_code;
+ char *s_code = NULL;
- curl_easy_getinfo(ch->cp, option, &s_code);
- RETURN_STRING(s_code, 1);
+ if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK &&
s_code) {
+ RETURN_STRING(s_code, 1);
+ } else {
+ RETURN_FALSE;
+ }
break;
}
@@ -1220,10 +1223,13 @@
case CURLINFO_FILETIME:
case CURLINFO_SSL_VERIFYRESULT:
case CURLINFO_REDIRECT_COUNT: {
- long code;
+ long code = 0;
- curl_easy_getinfo(ch->cp, option, &code);
- RETURN_LONG(code);
+ if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) {
+ RETURN_LONG(code);
+ } else {
+ RETURN_FALSE;
+ }
break;
}
@@ -1239,10 +1245,13 @@
case CURLINFO_CONTENT_LENGTH_UPLOAD:
case CURLINFO_STARTTRANSFER_TIME:
case CURLINFO_REDIRECT_TIME: {
- double code;
+ double code = 0.0;
- curl_easy_getinfo(ch->cp, option, &code);
- RETURN_DOUBLE(code);
+ if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) {
+ RETURN_DOUBLE(code);
+ } else {
+ RETURN_FALSE;
+ }
break;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php