File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -88,20 +88,20 @@ static zend_string *php_hex2bin(const unsigned char *old, const size_t oldlen)
8888 for (i = j = 0 ; i < target_length ; i ++ ) {
8989 unsigned char c = old [j ++ ];
9090 unsigned char l = c & ~0x20 ;
91- int is_letter = ((unsigned int ) ((l - 'A' ) ^ (l - 'F' - 1 ))) >> (8 * sizeof (unsigned int ) - 1 );
91+ uint32_t is_letter = ((uint32_t ) ((l - 'A' ) ^ (l - 'F' - 1 ))) >> (8 * sizeof (uint32_t ) - 1 );
9292 unsigned char d ;
9393
9494 /* basically (c >= '0' && c <= '9') || (l >= 'A' && l <= 'F') */
95- if (EXPECTED ((((c ^ '0' ) - 10 ) >> (8 * sizeof (unsigned int ) - 1 )) | is_letter )) {
95+ if (EXPECTED ((((c ^ '0' ) - 10 ) >> (8 * sizeof (uint32_t ) - 1 )) | is_letter )) {
9696 d = (l - 0x10 - 0x27 * is_letter ) << 4 ;
9797 } else {
9898 zend_string_efree (str );
9999 return NULL ;
100100 }
101101 c = old [j ++ ];
102102 l = c & ~0x20 ;
103- is_letter = ((unsigned int ) ((l - 'A' ) ^ (l - 'F' - 1 ))) >> (8 * sizeof (unsigned int ) - 1 );
104- if (EXPECTED ((((c ^ '0' ) - 10 ) >> (8 * sizeof (unsigned int ) - 1 )) | is_letter )) {
103+ is_letter = ((uint32_t ) ((l - 'A' ) ^ (l - 'F' - 1 ))) >> (8 * sizeof (uint32_t ) - 1 );
104+ if (EXPECTED ((((c ^ '0' ) - 10 ) >> (8 * sizeof (uint32_t ) - 1 )) | is_letter )) {
105105 d |= l - 0x10 - 0x27 * is_letter ;
106106 } else {
107107 zend_string_efree (str );
You can’t perform that action at this time.
0 commit comments