mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Fix several undefined behavior issues identified by @nrathaus.
Fixes #147.
This commit is contained in:
parent
a9a362254e
commit
bf60a5831b
12 changed files with 152 additions and 55 deletions
3
data.cpp
3
data.cpp
|
|
@ -78,6 +78,7 @@ int PycBuffer::getBuffer(int bytes, void* buffer)
|
|||
{
|
||||
if (m_pos + bytes > m_size)
|
||||
bytes = m_size - m_pos;
|
||||
memcpy(buffer, (m_buffer + m_pos), bytes);
|
||||
if (bytes != 0)
|
||||
memcpy(buffer, (m_buffer + m_pos), bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue