summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-11-02 01:47:03 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-11-02 02:16:35 +0300
commit5fae91432646637c4f8d10c6102b76068f889226 (patch)
treee480fe1ae9c1e90fdbe91cbeebe9845dc59b2d7f
parent2ec70dc812035bf3a2af2c1f024206e97d606d45 (diff)
downloadmicropython-5fae91432646637c4f8d10c6102b76068f889226.tar.gz
micropython-5fae91432646637c4f8d10c6102b76068f889226.zip
esp8266/etshal.h: Adjust size of MD5_CTX structure.
Size 64 was incorrect and will lead to stack corruption. Size 88 was verified empirically. Also, allow to skip defining it if MD5_CTX preprocessor macro is already defined (to avoid header conflict).
-rw-r--r--esp8266/etshal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/esp8266/etshal.h b/esp8266/etshal.h
index 28f9777919..90af63ba2d 100644
--- a/esp8266/etshal.h
+++ b/esp8266/etshal.h
@@ -24,7 +24,9 @@ extern void ets_wdt_disable(void);
extern void wdt_feed(void);
// Opaque structure
-typedef char MD5_CTX[64];
+#ifndef MD5_CTX
+typedef char MD5_CTX[88];
+#endif
void MD5Init(MD5_CTX *context);
void MD5Update(MD5_CTX *context, const void *data, unsigned int len);