-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed memcpy for template #352
Fixed memcpy for template #352
Conversation
@amgross Do you agree with PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with the integration
@@ -63,13 +63,16 @@ if (({$info.sizeTemp} <= {$info.maxSize}) && ({$info.dataTemp} != NULL)) | |||
{% if source == "server" || info.useMallocOnClientSide == true %} | |||
{$indent}{$info.name} = (uint8_t *) erpc_malloc({$info.maxSize} * sizeof(uint8_t)); | |||
{% if generateAllocErrorChecks == true %} | |||
{$indent}if (({$info.name} == NULL) && ({$info.sizeTemp} > 0)) | |||
{$indent}if ({$info.sizeTemp} > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still if generateAllocErrorChecks
is false the issue will happen, suggest to move this check outside the {% if generateAllocErrorChecks == true %}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
Hi guys, what do you think now? |
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
If you can next time not force push changes I will appreciate it. |
@amgross Sorry for that, i accidentally did commit with amend as i need to do in other project. They do not want a lot of commits. |
All fine, |
Thank you for resolving the discussion and providing this fix. |
Pull request
Choose Correct
Describe the pull request
memcpy could have undefined behavior
To Reproduce
Expected behavior
Screenshots
Desktop (please complete the following information):
Steps you didn't forgot to do
Additional context