1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

fix memory overflow

This commit is contained in:
sdeml 2019-01-18 14:49:12 +01:00
parent 7850ac7dbe
commit 710eab6eac

View file

@ -182,7 +182,7 @@ char* _sha256RoundConstraints()
auto json = r1cs_to_json(pb);
auto result = new char[json.size()];
auto result = new char[json.size() + 1];
memcpy(result, json.c_str(), json.size() + 1);
return result;
}
@ -231,7 +231,7 @@ char* _sha256RoundWitness(const uint8_t* inputs, int inputs_length)
auto json = array_to_json(pb);
auto result = new char[json.size()];
auto result = new char[json.size() + 1];
memcpy(result, json.c_str(), json.size() + 1);
return result;
}