From f211014dd3257e7e23e490fad744a7b65f7890e2 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Sun, 21 May 2017 10:30:03 -0500 Subject: [PATCH] SPIFFS: fix unaligned read in HAL (#3261) Ref. #3065 --- cores/esp8266/spiffs_hal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/spiffs_hal.cpp b/cores/esp8266/spiffs_hal.cpp index 7f3245c0d..2d66bd54d 100644 --- a/cores/esp8266/spiffs_hal.cpp +++ b/cores/esp8266/spiffs_hal.cpp @@ -60,7 +60,7 @@ int32_t spiffs_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) { __LINE__, addr, size, alignedBegin, alignedEnd); return SPIFFS_ERR_INTERNAL; } - memcpy(dst, &tmp + 4 - nb, nb); + memcpy(dst, ((uint8_t*) &tmp) + 4 - nb, nb); } if (alignedEnd != alignedBegin) {