mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
libi2pd: fix undefined behaviour and memory overruns
This fixes the following issues (flagged by cppcheck): [libi2pd/ECIESX25519AEADRatchetSession.cpp:537]: (error) Buffer is accessed out of bounds: m_NSREncodedKey [libi2pd/Identity.cpp:22]: (error) Buffer is accessed out of bounds: keys.publicKey [libi2pd/Identity.cpp:22]: (error) Buffer is accessed out of bounds: publicKey [libi2pd/NetDb.cpp:70] -> [libi2pd/NetDb.cpp:69]: (error) Iterator 'it' used after element has been erased [libi2pd/SSUData.cpp:186] -> [libi2pd/SSUData.cpp:187]: (warning) Shifting 32-bit value by 63 bits is undefined behaviour.
This commit is contained in:
parent
af794f901f
commit
a348e10620
4 changed files with 5 additions and 4 deletions
|
@ -534,7 +534,7 @@ namespace garlic
|
|||
LogPrint (eLogError, "Garlic: Can't encode elligator");
|
||||
return false;
|
||||
}
|
||||
memcpy (m_NSREncodedKey, out + offset, 56); // for possible next NSR
|
||||
memcpy (m_NSREncodedKey, out + offset, 32); // for possible next NSR
|
||||
memcpy (m_NSRH, m_H, 32);
|
||||
offset += 32;
|
||||
// KDF for Reply Key Section
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue