mirror of
https://github.com/openharmony/third_party_rust_encoding_rs.git
synced 2026-07-19 14:53:33 -04:00
fix OOB arithmetic in ASCII encoding
This commit is contained in:
+1
-1
@@ -220,7 +220,7 @@ macro_rules! basic_latin_alu {
|
||||
let dst_until_alignment = (ALU_ALIGNMENT
|
||||
- ((dst as usize) & ALU_ALIGNMENT_MASK))
|
||||
& ALU_ALIGNMENT_MASK;
|
||||
if (src.add(dst_until_alignment) as usize) & ALU_ALIGNMENT_MASK != 0 {
|
||||
if (src.wrapping_add(dst_until_alignment) as usize) & ALU_ALIGNMENT_MASK != 0 {
|
||||
break;
|
||||
}
|
||||
dst_until_alignment
|
||||
|
||||
Reference in New Issue
Block a user