From: Moriyoshi Koizumi Date: Fri, 25 Oct 2002 09:36:36 +0000 (+0000) Subject: Fixed null value check in php_mb_mbchar_bytes_ex() as it should be X-Git-Tag: php-4.3.0pre2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36447ebe050ac0891d90d3ebff099b8c960094ac;p=php Fixed null value check in php_mb_mbchar_bytes_ex() as it should be --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4d2bf3b2ec..d48c937a93 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -3451,7 +3451,7 @@ PHPAPI size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc) if (enc != NULL) { if(enc->flag & MBFL_ENCTYPE_MBCS) { if(enc->mblen_table != NULL) { - if (*s != '\0') return enc->mblen_table[*(unsigned char *)s]; + if (s != NULL) return enc->mblen_table[*(unsigned char *)s]; } } else if (enc->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) { return 2;