Skip to content

Conversation

@BlueAndi
Copy link
Contributor

Summary

Traversing a variable argument list twice may cause unexpected behaviour. Therefore the variable argument list 'arg' is copied to 'copy'. Unfortunately in line 484 'copy' is not used to retrieve the length, but 'arg'.
Additional if the retrieved length is greater or equal than the available buffer, the clean-up of the variable argument list 'arg' is missing.

Impact

This may cause unexpected and compiler dependend behaviour, because 'arg' is used in line some lines below again.
The missing clean-up of the variable argument list may lead to a memory leak, but depends on the compiler.

… to retrieve length. If length is greater or equal than the available buffer, a memory leak will happen because va_end() is missing.
@me-no-dev me-no-dev merged commit 4da1051 into espressif:master Mar 2, 2022
@me-no-dev
Copy link
Member

Thanks @BlueAndi :)

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