ringct: prevent a potential very large allocation

Reported by QuarksLab.
release-v0.5.1
moneromooo-monero 6 years ago
parent a4317e61b5
commit 61632dc166
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

@ -317,9 +317,9 @@ namespace rct {
ar.begin_array();
uint32_t nbp = bulletproofs.size();
FIELD(nbp)
PREPARE_CUSTOM_VECTOR_SERIALIZATION(nbp, bulletproofs);
if (bulletproofs.size() > outputs)
if (nbp > outputs)
return false;
PREPARE_CUSTOM_VECTOR_SERIALIZATION(nbp, bulletproofs);
for (size_t i = 0; i < nbp; ++i)
{
FIELDS(bulletproofs[i])

Loading…
Cancel
Save