Skip to content

Commit ca67548

Browse files
committed
Merge #121: js: check for validity when analyzing a Miniscript
1f6c596 js: check for validity when analyzing a Miniscript (Antoine Poinsot) Pull request description: I wanted to be more helpful if it's an issue with validty and output the first insane sub with no child, but we also accept invalid miniscripts there. So, at least just check for validity. I did not test this code. ACKs for top commit: sipa: utACK 1f6c596 Tree-SHA512: bb119dfb822bc39e454de12c8e79d3425594197f42393ed5be06e71ff8bd8c739ef451a1fc719b48f4fbb36c8fbc8bb2fc7afae53285b7eeb924330c8526c96b
2 parents fa7ea77 + 1f6c596 commit ca67548

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js_bindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void miniscript_analyze(const char* ms, char* costout, int costoutlen, char* asm
119119
str.erase(str.find_last_not_of(" \n\r\t") + 1);
120120
miniscript::NodeRef<std::string> ret;
121121
ret = miniscript::FromString(Expand(str), COMPILER_CTX);
122-
if (!ret) {
122+
if (!ret || !ret->IsValidTopLevel()) {
123123
Output("[analysis error]", costout, costoutlen);
124124
Output("[analysis error]", asmout, asmoutlen);
125125
return;

0 commit comments

Comments
 (0)