Skip to content

Commit 61c5491

Browse files
committed
fix undefined behavior in confidential commitment serialization
1 parent 1920d84 commit 61c5491

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/primitives/transaction.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ class CConfidentialCommitment
5656
}
5757
vchCommitment[0] = version;
5858
}
59-
if (vchCommitment.size() > 1)
60-
READWRITE(REF(CFlatData(&vchCommitment[1], &vchCommitment[vchCommitment.size()])));
59+
if (vchCommitment.size() > 1) {
60+
READWRITE(REF(CFlatData(vchCommitment.data() + 1, vchCommitment.data() + vchCommitment.size())));
61+
}
6162
}
6263

6364
/* Null is the default state when no explicit asset or confidential

0 commit comments

Comments
 (0)