6.2.1.2 - Fix KNX PA exception

6.2.1.2 20180906
 * Fix KNX PA exception. Regression from 6.2.1 buffer overflow (#3700, #3710)
This commit is contained in:
Theo Arends 2018-09-06 10:42:22 +02:00
parent 3f1f3dec34
commit 359877489d
4 changed files with 13 additions and 7 deletions

View File

@ -1,4 +1,7 @@
/* 6.2.1.1 20180905
/* 6.2.1.2 20180906
* Fix KNX PA exception. Regression from 6.2.1 buffer overflow (#3700, #3710)
*
* 6.2.1.1 20180905
* Rewrite energy monitoring using energy sensor driver modules
* Add Wifi channel number to state message (#3664)
* Add support for Shelly 1 and basic support for Shelly 2 - No energy monitoring yet (#2789)

View File

@ -64,7 +64,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t data; // Allow bit manipulation using SetOption
struct { // SetOption50 .. SetOption81
uint32_t timers_enable : 1; // bit 0 (v6.1.1b)
uint32_t spare01 : 1;
uint32_t user_esp8285_enable : 1; // bit 1 (v6.1.1.14)
uint32_t spare02 : 1;
uint32_t spare03 : 1;
uint32_t spare04 : 1;
@ -94,7 +94,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t spare28 : 1;
uint32_t spare29 : 1;
uint32_t spare30 : 1;
uint32_t user_esp8285_enable : 1; // bit 31 (v6.1.1.14)
uint32_t spare31 : 1;
};
} SysBitfield3;

View File

@ -843,9 +843,11 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
else if ((CMND_GPIO == command_code) && (index < MAX_GPIO_PIN)) {
mytmplt cmodule;
memcpy_P(&cmodule, &kModules[Settings.module], sizeof(cmodule));
if ((GPIO_USER == cmodule.gp.io[index]) && (payload >= 0) && (payload < GPIO_SENSOR_END)) {
// if ((GPIO_USER == cmodule.gp.io[index]) && (payload >= 0) && (payload < GPIO_SENSOR_END)) {
if ((GPIO_USER == ValidGPIO(index, cmodule.gp.io[index])) && (payload >= 0) && (payload < GPIO_SENSOR_END)) {
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
if ((GPIO_USER == cmodule.gp.io[i]) && (Settings.my_gp.io[i] == payload)) {
// if ((GPIO_USER == cmodule.gp.io[i]) && (Settings.my_gp.io[i] == payload)) {
if ((GPIO_USER == ValidGPIO(i, cmodule.gp.io[i])) && (Settings.my_gp.io[i] == payload)) {
Settings.my_gp.io[i] = 0;
}
}
@ -854,7 +856,8 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{"));
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
if (GPIO_USER == cmodule.gp.io[i]) {
// if (GPIO_USER == cmodule.gp.io[i]) {
if (GPIO_USER == ValidGPIO(i, cmodule.gp.io[i])) {
if (jsflg) snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,"), mqtt_data);
jsflg = 1;
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s\"" D_CMND_GPIO "%d\":\"%d (%s)\""),

View File

@ -20,7 +20,7 @@
#ifndef _SONOFF_VERSION_H_
#define _SONOFF_VERSION_H_
#define VERSION 0x06020101
#define VERSION 0x06020102
#define D_PROGRAMNAME "Sonoff-Tasmota"
#define D_AUTHOR "Theo Arends"