File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -1287,7 +1287,7 @@ pub fn parse_chunk_size(buf: &[u8])
12871287 size *= RADIX ;
12881288 size += ( b - b'0' ) as u64 ;
12891289 } ,
1290- b'a' ..= b'f' if in_chunk_size => {
1290+ b'a' ..= b'f' | b'A' ..= b'F' if in_chunk_size => {
12911291 if count > 15 {
12921292 return Err ( InvalidChunkSize ) ;
12931293 }
@@ -1296,18 +1296,7 @@ pub fn parse_chunk_size(buf: &[u8])
12961296 return Err ( InvalidChunkSize ) ;
12971297 }
12981298 size *= RADIX ;
1299- size += ( b + 10 - b'a' ) as u64 ;
1300- }
1301- b'A' ..= b'F' if in_chunk_size => {
1302- if count > 15 {
1303- return Err ( InvalidChunkSize ) ;
1304- }
1305- count += 1 ;
1306- if cfg ! ( debug_assertions) && size > ( u64:: MAX / RADIX ) {
1307- return Err ( InvalidChunkSize ) ;
1308- }
1309- size *= RADIX ;
1310- size += ( b + 10 - b'A' ) as u64 ;
1299+ size += ( ( b | 0x20 ) + 10 - b'a' ) as u64 ;
13111300 }
13121301 b'\r' => {
13131302 match next ! ( bytes) {
You can’t perform that action at this time.
0 commit comments