Skip to content
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

Renaming "new" variable #1783

Merged
merged 5 commits into from Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,5 +1,11 @@
mbed TLS ChangeLog (Sorted per branch, date)


= mbed TLS x.x.x branch released xxxx-xx-xx

Bugfix
* Fix compilation error on c++, because of a variable named new. Found and fixed by Hirotaka Niisato in #1783
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into multiple lines to avoid lines of more than 80 characters. Also, please add a full stop at the end of the second sentence, and capitalize C++.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanno-arm
Now I update the ChangeLog.
Thank you.


= mbed TLS 2.11.0 branch released 2018-06-18

Features
Expand Down
16 changes: 8 additions & 8 deletions library/ssl_tls.c
Expand Up @@ -5995,27 +5995,27 @@ static int ssl_append_key_cert( mbedtls_ssl_key_cert **head,
mbedtls_x509_crt *cert,
mbedtls_pk_context *key )
{
mbedtls_ssl_key_cert *new;
mbedtls_ssl_key_cert *new_cert;

new = mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );
if( new == NULL )
new_cert = mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );
if( new_cert == NULL )
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );

new->cert = cert;
new->key = key;
new->next = NULL;
new_cert->cert = cert;
new_cert->key = key;
new_cert->next = NULL;

/* Update head is the list was null, else add to the end */
if( *head == NULL )
{
*head = new;
*head = new_cert;
}
else
{
mbedtls_ssl_key_cert *cur = *head;
while( cur->next != NULL )
cur = cur->next;
cur->next = new;
cur->next = new_cert;
}

return( 0 );
Expand Down