diff --git a/tasmota/xdrv_79_esp32_ble.ino b/tasmota/xdrv_79_esp32_ble.ino index c9586a45e..5775c3016 100644 --- a/tasmota/xdrv_79_esp32_ble.ino +++ b/tasmota/xdrv_79_esp32_ble.ino @@ -1015,6 +1015,18 @@ int fromHex(uint8_t *dest, const char *src, int maxlen){ t[0] = src[i*2]; t[1] = src[i*2 + 1]; t[2] = 0; + t[0] |= 0x20; + t[1] |= 0x20; + if (isalpha(t[0])){ + if (t[0] < 'a' || t[0] > 'f'){ + return 0; + } + } + if (isalpha(t[1])){ + if (t[1] < 'a' || t[1] > 'f'){ + return 0; + } + } int byte = strtol(t, NULL, 16); *dest++ = byte;