Skip to content

prevent memcpy with nullptr#63

Merged
richiware merged 1 commit intoeProsima:masterfrom
geoffviola:prevent_memcpy_with_nullptr
Dec 12, 2019
Merged

prevent memcpy with nullptr#63
richiware merged 1 commit intoeProsima:masterfrom
geoffviola:prevent_memcpy_with_nullptr

Conversation

@geoffviola
Copy link
Copy Markdown
Contributor

I noticed that sometimes serializeArray is called with 0 elements. A vector with a capacity of 0 can have data pointing to nullptr. This means that a memcpy call can occur with the first argument as nullptr. According to the C standard, this is undefined behavior.

@richiware
Copy link
Copy Markdown
Member

Build status:

  • Linux Build Status
  • Windows Build Status

@richiware richiware merged commit b1fcd89 into eProsima:master Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants