Skip to content

Commit aba96b8

Browse files
committed
fix write_os_str_to_wide_str
1 parent e4a2715 commit aba96b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shims/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
146146
let this = self.eval_context_mut();
147147
let mut alloc = this
148148
.memory
149-
.get_mut(sptr, Size::from_bytes(string_length), Align::from_bytes(2).unwrap())?
149+
.get_mut(sptr, size2 * string_length, Align::from_bytes(2).unwrap())?
150150
.unwrap(); // not a ZST, so we will get a result
151151
for (offset, wchar) in u16_vec.into_iter().chain(iter::once(0x0000)).enumerate() {
152152
let offset = u64::try_from(offset).unwrap();

0 commit comments

Comments
 (0)