From c369289cb58c0a260d1d2cd3e759b4e2e14a048b Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Tue, 24 Sep 2019 15:30:26 +0200 Subject: [PATCH] Update xdrv_10_scripter.ino --- sonoff/xdrv_10_scripter.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sonoff/xdrv_10_scripter.ino b/sonoff/xdrv_10_scripter.ino index 5c7b7b6ae..40fa40391 100644 --- a/sonoff/xdrv_10_scripter.ino +++ b/sonoff/xdrv_10_scripter.ino @@ -42,8 +42,9 @@ keywords if then else endif, or, and are better readable for beginners (others m #define SCRIPT_DEBUG 0 #define MAXVARS 50 -#define MAXNVARS 45 #define MAXSVARS 5 +#define MAXNVARS MAXVARS-MAXSVARS + #define MAXFILT 5 #define SCRIPT_SVARSIZE 20 #define SCRIPT_MAXSSIZE 48 @@ -465,6 +466,10 @@ char *script; } namep++; index++; + if (index>255) { + free(glob_script_mem.script_mem); + return -5; + } } // copy string variables