@@ -5697,6 +5697,14 @@ static FnCallResult FnCallFormat(EvalContext *ctx, ARG_UNUSED const Policy *poli
5697
5697
static FnCallResult FnCallIPRange (EvalContext * ctx , ARG_UNUSED const Policy * policy ,
5698
5698
const FnCall * fp , const Rlist * finalargs )
5699
5699
{
5700
+ assert (fp != NULL );
5701
+
5702
+ if (finalargs == NULL )
5703
+ {
5704
+ Log (LOG_LEVEL_ERR , "Function '%s' requires at least one argument" , fp -> name );
5705
+ return FnFailure ();
5706
+ }
5707
+
5700
5708
const char * range = RlistScalarValue (finalargs );
5701
5709
const Rlist * ifaces = finalargs -> next ;
5702
5710
@@ -5761,6 +5769,14 @@ static FnCallResult FnCallIsIpInSubnet(ARG_UNUSED EvalContext *ctx,
5761
5769
ARG_UNUSED const Policy * policy ,
5762
5770
const FnCall * fp , const Rlist * finalargs )
5763
5771
{
5772
+ assert (fp != NULL );
5773
+
5774
+ if (finalargs == NULL )
5775
+ {
5776
+ Log (LOG_LEVEL_ERR , "Function '%s' requires at least one argument" , fp -> name );
5777
+ return FnFailure ();
5778
+ }
5779
+
5764
5780
const char * range = RlistScalarValue (finalargs );
5765
5781
const Rlist * ips = finalargs -> next ;
5766
5782
@@ -6878,6 +6894,12 @@ static FnCallResult FnCallEval(EvalContext *ctx, ARG_UNUSED const Policy *policy
6878
6894
6879
6895
static FnCallResult FnCallReadFile (ARG_UNUSED EvalContext * ctx , ARG_UNUSED const Policy * policy , ARG_UNUSED const FnCall * fp , const Rlist * finalargs )
6880
6896
{
6897
+ if (finalargs == NULL )
6898
+ {
6899
+ Log (LOG_LEVEL_ERR , "Function 'readfile' requires at least one argument" );
6900
+ return FnFailure ();
6901
+ }
6902
+
6881
6903
char * filename = RlistScalarValue (finalargs );
6882
6904
const Rlist * next = finalargs -> next ; // max_size argument, default to inf:
6883
6905
long maxsize = next ? IntFromString (RlistScalarValue (next )) : IntFromString ("inf" );
0 commit comments