]> git.lizzy.rs Git - rust.git/commitdiff
Fix 'RtlGenRandom' argument slots
authorAaron Hill <aa1ronham@gmail.com>
Tue, 9 Apr 2019 03:18:10 +0000 (23:18 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Tue, 9 Apr 2019 03:18:10 +0000 (23:18 -0400)
src/fn_call.rs

index 94e1f11ccf79369ae8cc7cf411c01292c5be05ad..8a586c7705b33e7de0534d51c5eeb404e28b4e41 100644 (file)
@@ -756,8 +756,8 @@ fn emulate_foreign_item(
             }
             // The actual name of 'RtlGenRandom'
             "SystemFunction036" => {
-                let ptr = this.read_scalar(args[1])?.to_ptr()?;
-                let len = this.read_scalar(args[2])?.to_usize(this)?;
+                let ptr = this.read_scalar(args[0])?.to_ptr()?;
+                let len = this.read_scalar(args[1])?.to_usize(this)?;
 
                 let data = gen_random(this, len as usize)?;
                 this.memory_mut().get_mut(ptr.alloc_id)?