Fix vulnerability in append() pseudocode.

This addresses finding NCC-1908_Zcash-001.
This commit is contained in:
Jack Grigg 2020-03-04 09:12:16 +13:00 committed by Daira Hopwood
parent a627029132
commit 5b411837f4
1 changed files with 1 additions and 0 deletions

View File

@ -499,6 +499,7 @@ With each new block ``B_n``, we append a new MMR leaf node corresponding to bloc
else: else:
merged.append(current) merged.append(current)
current = peak current = peak
merged.append(current)
# finally, bag the merged peaks # finally, bag the merged peaks
return bag_peaks(merged[::-1]) return bag_peaks(merged[::-1])