Hi,

See attached a very small patch (based on allmerged tree) to fix "sizeof".

Regards,

--
Emilien Mantel

Le 18/06/2010 02:01, Peter Stuge a écrit :
David Sommerseth wrote:
3) "sizeof(common_name)" is useless... Line 745: char
common_name[TLS_USERNAME_LEN]; we can use directly TLS_USERNAME_LEN.
Thanks a lot for the patch and all rework done.  (Also: thank you to all
reviewers!)

The third and last patch looks very good!  I've applied it to the
feat_misc branch and merged it into allmerged.
I strongly agree with Alon about sizeof() rather than a second
reference to the same define. It is the defensive way.


//Peter

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

diff --git a/ssl.c b/ssl.c
index f6e2410..8c7a5ee 100644
--- a/ssl.c
+++ b/ssl.c
@@ -779,7 +779,7 @@ verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
   string_replace_leading (subject, '-', '_');

   /* extract the username (default is CN) */
-  if (!extract_x509_field_ssl (X509_get_subject_name (ctx->current_cert), x509_username_field, common_name, TLS_USERNAME_LEN))
+  if (!extract_x509_field_ssl (X509_get_subject_name (ctx->current_cert), x509_username_field, common_name, sizeof(common_name)))
     {
       if (!ctx->error_depth)
         {

Reply via email to