cvs: php4(PHP_4_3) /ext/standard url_scanner_ex.re
| From: | Sascha Schumann | Date: | Tue, 11 Mar 2003 02:31:52 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/standard url_scanner_ex.re | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-19522@lists.php.net to get a copy of this message | ||
sas Mon Mar 10 21:31:52 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/standard url_scanner_ex.re
Log:
fix sizeof(size_t) > sizeof(uint) issue
Index: php4/ext/standard/url_scanner_ex.re
diff -u php4/ext/standard/url_scanner_ex.re:1.63.2.3 php4/ext/standard/url_scanner_ex.re:1.63.2.4
--- php4/ext/standard/url_scanner_ex.re:1.63.2.3 Mon Mar 10 20:50:18 2003
+++ php4/ext/standard/url_scanner_ex.re Mon Mar 10 21:31:52 2003
@@ -21,6 +21,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -411,8 +414,15 @@
static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output,
uint *handled_output_len, int mode TSRMLS_DC)
{
+ size_t len;
+
if (BG(url_adapt_state_ex).url_app.len != 0) {
- *handled_output = url_adapt_ext(output, output_len, handled_output_len, (zend_bool)
(mode&PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC);
+ *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool)
(mode&PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC);
+ if (sizeof(uint) < sizeof(size_t)) {
+ if (len > UINT_MAX)
+ len = UINT_MAX;
+ }
+ *handled_output_len = len;
} else {
*handled_output = NULL;
}