Skip to content

Commit

Permalink
Limit the number of opcodes in FromScript
Browse files Browse the repository at this point in the history
  • Loading branch information
meshcollider committed Aug 19, 2021
1 parent f7de269 commit b59f17d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bitcoin/script/miniscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ inline NodeRef<typename Ctx::Key> FromScript(const CScript& script, const Ctx& c
using namespace internal;
std::vector<std::pair<opcodetype, std::vector<unsigned char>>> decomposed;
if (!DecomposeScript(script, decomposed)) return {};
if (decomposed.size() > 201) return {};
auto it = decomposed.begin();
auto ret = DecodeMulti<typename Ctx::Key>(it, decomposed.end(), ctx);
if (!ret) return {};
Expand Down

0 comments on commit b59f17d

Please sign in to comment.