fix region checks (#11651) (#11785)

(cherry picked from commit 768b386f0a)

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2020-08-22 01:14:13 +00:00
committed by GitHub
parent cdf6ff7907
commit 2b4e0abb43
2 changed files with 4 additions and 7 deletions

View File

@@ -139,16 +139,13 @@ impl Pubkey {
address_bytes_addr: *const u8,
) -> u64;
};
let bytes = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
];
let mut bytes = [0; 32];
let result = unsafe {
sol_create_program_address(
seeds as *const _ as *const u8,
seeds.len() as u64,
program_id as *const _ as *const u8,
&bytes as *const _ as *const u8,
&mut bytes as *mut _ as *mut u8,
)
};
match result {