Skip to content

Commit 1f6c596

Browse files
committed
js: check for validity when analyzing a Miniscript
1 parent fa7ea77 commit 1f6c596

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)