From e3a480faf8a24f020707df4db19509ff389f7578 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 20 Jul 2004 01:03:34 +0000 Subject: [PATCH] MFH: Fixed bug #29226 (ctype_* functions missing validation of numeric string representations). --- NEWS | 2 ++ ext/ctype/ctype.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2f9b960a03..504bf36380 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP 4 NEWS - Updated PCRE to provide better error handling in certain cases. (Andrei) - NSAPI: added "bucket" parameter to list of non-php.ini-keys of php4_execute for doing performance stats without warnings in server-log. (Uwe Schindler) +- Fixed bug #29226 (ctype_* functions missing validation of numeric string + representations). (Ilia) - Fixed bug #29116 (Zend constant warning uses memory after free). (Marcus, jdolecek at NetBSD dot org) - Fixed bug #29114 (Potential double free in php_stat). (Sara) diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index f755d7e33f..0291979010 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -97,7 +97,11 @@ PHP_MINFO_FUNCTION(ctype) return; \ switch (Z_TYPE_P(c)) { \ case IS_LONG: \ - RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ + if (Z_LVAL_P(c) < 255 && Z_LVAL_P(c) > -127) { \ + RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ + } \ + SEPARATE_ZVAL(&c); \ + convert_to_string(c); \ case IS_STRING: \ { \ char *p; \ -- 2.40.0