From 6ae7da4b1a2d96b3444dd66f47b6db68dad65799 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 14:51:22 +0200 Subject: [PATCH] Missing check in setGlobalVariable(...) --- radio/src/lua.cpp | 2 +- radio/src/myeeprom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index 5cdf45328..bb6ed9dff 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -758,7 +758,7 @@ static int luaModelSetGlobalVariable(lua_State *L) int idx = luaL_checkunsigned(L, 1); int phase = luaL_checkunsigned(L, 2); int value = luaL_checkinteger(L, 3); - if (phase < MAX_PHASES && idx < MAX_GVARS && value <= 500) { + if (phase < MAX_PHASES && idx < MAX_GVARS && value >= -GVAR_LIMIT && value <= GVAR_LIMIT) { g_model.phaseData[phase].gvars[idx] = value; } return 0; diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 6380066a8..16018bf3a 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -916,7 +916,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data #define CFN_GVAR_MODE(p) ((p)->all.mode) #define CFN_PARAM(p) ((p)->all.val) #define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0) -#define CFN_GVAR_CST_MAX 500 +#define CFN_GVAR_CST_MAX GVAR_LIMIT #else PACK(typedef struct t_CustomFnData { PACK(union {