Skip to content

Commit

Permalink
fix i256 key type conversion by initialize buffer before usage
Browse files Browse the repository at this point in the history
  • Loading branch information
learnforpractice committed Jun 9, 2023
1 parent 1c607bd commit 0974eac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ class read_write : public api_base {
// the following will convert the input to array of 2 uint128_t in little endian, i.e. 50f0fa8360ec998f4bb65b00c86282f5 fb54b91bfed2fe7fe39a92d999d002c5
// which is the format used by secondary index
chain::key256_t k;
uint8_t buffer[32];
uint8_t buffer[32] = {};
boost::multiprecision::export_bits(v, buffer, 8, false);
memcpy(&k[0], buffer + 16, 16);
memcpy(&k[1], buffer, 16);
Expand Down

0 comments on commit 0974eac

Please sign in to comment.