[exim-cvs] expanded comment, noting size types and API issue

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Exim Git Commits Mailing List
Date:  
À: exim-cvs
Sujet: [exim-cvs] expanded comment, noting size types and API issue
Gitweb: http://git.exim.org/exim.git/commitdiff/60788a1cfdd64787ed6513986af2335b51d89766
Commit:     60788a1cfdd64787ed6513986af2335b51d89766
Parent:     c2b063d407d37f6d813cdc4bc9d6a346f071a471
Author:     Phil Pennock <pdp@???>
AuthorDate: Wed May 23 01:20:09 2012 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Wed May 23 01:20:09 2012 -0400


    expanded comment, noting size types and API issue
---
 src/src/tls-gnu.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index 0ac72ad..b2659d7 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -512,7 +512,11 @@ if (rc < 0)
   m.data = malloc(m.size);
   if (m.data == NULL)
     return tls_error(US"memory allocation failed", strerror(errno), NULL);
-  /* this will return a size 1 less than the allocation size above */
+  /* this will return a size 1 less than the allocation size above; I
+  originally used sz so as to avoid type compatibility errors, as gnutls_datum
+  uses "unsigned int" for the size field, but this call takes separate data
+  and size fields, with the latter being a size_t*.  For now, we live with
+  the error as being safer than throwing away type information. */
   rc = gnutls_dh_params_export_pkcs3(dh_server_params, GNUTLS_X509_FMT_PEM,
       m.data, &m.size);
   if (rc != GNUTLS_E_SUCCESS)