diff options
| author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2011-09-05 00:39:39 +0000 |
|---|---|---|
| committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2011-09-05 00:39:39 +0000 |
| commit | dbe8c7c4fae2a89465091b31d5a67dddc48318d0 (patch) | |
| tree | 543623bebf53ac3f62ce4f6dc7af0c2689ea33a2 /ext/mysqlnd/mysqlnd_charset.c | |
| parent | cc45ce4586664fa07a3d2b11c3e6d7d76859f3b8 (diff) | |
| download | php-git-dbe8c7c4fae2a89465091b31d5a67dddc48318d0.tar.gz | |
- Fixed bad xor in signed types due to integer promotion.
- Replaced undefined signed overflow with char -> unsigned char conversion.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_charset.c')
| -rw-r--r-- | ext/mysqlnd/mysqlnd_charset.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index 191fd4ceb4..b44c2a8053 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -122,11 +122,11 @@ static unsigned int check_mb_utf8_sequence(const char *start, const char *end) [F4][80..8F][80..BF][80..BF] */ - if (!((start[1] ^ 0x80) < 0x40 && - (start[2] ^ 0x80) < 0x40 && - (start[3] ^ 0x80) < 0x40 && - (c >= 0xf1 || start[1] >= (char)0x90) && - (c <= 0xf3 || start[1] <= (char)0x8F))) + if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && + ((zend_uchar)start[2] ^ 0x80) < 0x40 && + ((zend_uchar)start[3] ^ 0x80) < 0x40 && + (c >= 0xf1 || (zend_uchar)start[1] >= 0x90) && + (c <= 0xf3 || (zend_uchar)start[1] <= 0x8F))) { return 0; /* invalid utf8 character */ } |
