We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ac5d70 commit 2adda59Copy full SHA for 2adda59
libraries/EEPROM/EEPROM.h
@@ -37,7 +37,7 @@ class EEPROMClass
37
38
template<typename T> T &get(int address, T &t)
39
{
40
- if (address < 0 || address >= _size)
+ if (address < 0 || address + sizeof(T) > _size)
41
return t;
42
43
uint8_t *ptr = (uint8_t*) &t;
@@ -47,7 +47,7 @@ class EEPROMClass
47
48
template<typename T> const T &put(int address, const T &t)
49
50
51
52
53
const uint8_t *ptr = (const uint8_t*) &t;
0 commit comments