]> Repositorios git - scryer-prolog.git/commitdiff
throw instantiation error if the list of options contains a variable (#523)
authorMarkus Triska <[email protected]>
Mon, 18 May 2020 07:58:09 +0000 (09:58 +0200)
committerMarkus Triska <[email protected]>
Mon, 18 May 2020 07:58:09 +0000 (09:58 +0200)
Many thanks to @notoria for the test case!

src/prolog/lib/crypto.pl

index be6b6b31bb24143db31c1a799e40f279f42286bc..7a24643222556f2d2fd3e672741d87522f03e5e8 100644 (file)
@@ -259,6 +259,10 @@ crypto_data_hkdf(Data0, L, Bytes, Options0) :-
         '$crypto_data_hkdf'(Data, SaltBytes, Info, Algorithm, L, Bytes).
 
 option(What, Options, Default) :-
+        (   member(V, Options), var(V) ->
+            instantiation_error(option/3)
+        ;   true
+        ),
         (   member(What, Options) -> true
         ;   What =.. [_,Default]
         ).