From: Pierre Joye Date: Sat, 29 Jul 2006 12:43:21 +0000 (+0000) Subject: - #8315, flaot is affected too X-Git-Tag: php-5.2.0RC2~163 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5317b7050b23713f92483f608bf10a2f8cad298d;p=php - #8315, flaot is affected too --- diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index c299d13e59..14933c9db4 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -330,6 +330,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ } i++; str[i] = '\0'; + end = str + i - 1; } if (*str == '-') { @@ -423,6 +424,9 @@ stateExp: } stateT: + if ((str -1) != end) { + goto stateError; + } if (exp_value) { exp_value *= exp_multiply; ret_val *= pow(10, exp_value); diff --git a/ext/filter/tests/bug8315.phpt b/ext/filter/tests/bug8315.phpt index 5e65590ecd..e5c6bc1c37 100644 --- a/ext/filter/tests/bug8315.phpt +++ b/ext/filter/tests/bug8315.phpt @@ -5,6 +5,9 @@ bug 8315, NULL values halt the validation $var="3".chr(0)."foo"; var_dump(filter_data($var, FILTER_VALIDATE_INT)); +$var="3".chr(0)."foo"; +var_dump(filter_data($var, FILTER_VALIDATE_FLOAT)); ?> --EXPECTF-- bool(false) +bool(false)