diff options
Diffstat (limited to 'src/lib/libssl/src/crypto/asn1/a_utf8.c')
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_utf8.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libssl/src/crypto/asn1/a_utf8.c b/src/lib/libssl/src/crypto/asn1/a_utf8.c index b5125af224..854278f136 100644 --- a/src/lib/libssl/src/crypto/asn1/a_utf8.c +++ b/src/lib/libssl/src/crypto/asn1/a_utf8.c | |||
@@ -133,7 +133,7 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val) | |||
133 | if( ((p[1] & 0xc0) != 0x80) | 133 | if( ((p[1] & 0xc0) != 0x80) |
134 | || ((p[2] & 0xc0) != 0x80) | 134 | || ((p[2] & 0xc0) != 0x80) |
135 | || ((p[3] & 0xc0) != 0x80) ) return -3; | 135 | || ((p[3] & 0xc0) != 0x80) ) return -3; |
136 | value = (*p++ & 0x7) << 18; | 136 | value = ((unsigned long)(*p++ & 0x7)) << 18; |
137 | value |= (*p++ & 0x3f) << 12; | 137 | value |= (*p++ & 0x3f) << 12; |
138 | value |= (*p++ & 0x3f) << 6; | 138 | value |= (*p++ & 0x3f) << 6; |
139 | value |= *p++ & 0x3f; | 139 | value |= *p++ & 0x3f; |
@@ -145,9 +145,9 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val) | |||
145 | || ((p[2] & 0xc0) != 0x80) | 145 | || ((p[2] & 0xc0) != 0x80) |
146 | || ((p[3] & 0xc0) != 0x80) | 146 | || ((p[3] & 0xc0) != 0x80) |
147 | || ((p[4] & 0xc0) != 0x80) ) return -3; | 147 | || ((p[4] & 0xc0) != 0x80) ) return -3; |
148 | value = (*p++ & 0x3) << 24; | 148 | value = ((unsigned long)(*p++ & 0x3)) << 24; |
149 | value |= (*p++ & 0x3f) << 18; | 149 | value |= ((unsigned long)(*p++ & 0x3f)) << 18; |
150 | value |= (*p++ & 0x3f) << 12; | 150 | value |= ((unsigned long)(*p++ & 0x3f)) << 12; |
151 | value |= (*p++ & 0x3f) << 6; | 151 | value |= (*p++ & 0x3f) << 6; |
152 | value |= *p++ & 0x3f; | 152 | value |= *p++ & 0x3f; |
153 | if(value < 0x200000) return -4; | 153 | if(value < 0x200000) return -4; |
@@ -159,10 +159,10 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val) | |||
159 | || ((p[3] & 0xc0) != 0x80) | 159 | || ((p[3] & 0xc0) != 0x80) |
160 | || ((p[4] & 0xc0) != 0x80) | 160 | || ((p[4] & 0xc0) != 0x80) |
161 | || ((p[5] & 0xc0) != 0x80) ) return -3; | 161 | || ((p[5] & 0xc0) != 0x80) ) return -3; |
162 | value = (*p++ & 0x1) << 30; | 162 | value = ((unsigned long)(*p++ & 0x1)) << 30; |
163 | value |= (*p++ & 0x3f) << 24; | 163 | value |= ((unsigned long)(*p++ & 0x3f)) << 24; |
164 | value |= (*p++ & 0x3f) << 18; | 164 | value |= ((unsigned long)(*p++ & 0x3f)) << 18; |
165 | value |= (*p++ & 0x3f) << 12; | 165 | value |= ((unsigned long)(*p++ & 0x3f)) << 12; |
166 | value |= (*p++ & 0x3f) << 6; | 166 | value |= (*p++ & 0x3f) << 6; |
167 | value |= *p++ & 0x3f; | 167 | value |= *p++ & 0x3f; |
168 | if(value < 0x4000000) return -4; | 168 | if(value < 0x4000000) return -4; |