gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, gnutls_2_8_x, updated. gnutls_2_8_3-6-g68fa3fc


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, gnutls_2_8_x, updated. gnutls_2_8_3-6-g68fa3fc
Date: Mon, 31 Aug 2009 19:06:13 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=68fa3fc4517acb9e44536a9ff39d031752fbf80e

The branch, gnutls_2_8_x has been updated
       via  68fa3fc4517acb9e44536a9ff39d031752fbf80e (commit)
      from  4a711dbb226fcc9425a57857753c4196c759fc11 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 68fa3fc4517acb9e44536a9ff39d031752fbf80e
Author: Simon Josefsson <address@hidden>
Date:   Mon Aug 31 20:59:14 2009 +0200

    Handle XMPP SANs properly.
    Reported by Howard Chu <address@hidden> in
    <https://savannah.gnu.org/support/?106975>.

-----------------------------------------------------------------------

Summary of changes:
 lib/x509/x509.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 91ddc32..3acd002 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -1012,6 +1012,7 @@ _gnutls_parse_general_name (ASN1_TYPE src, const char 
*src_name,
          if (len > strlen (XMPP_OID) && strcmp (oid, XMPP_OID) == 0)
            {
              ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
+             size_t orig_name_size = *name_size;
 
              result = asn1_create_element
                (_gnutls_get_pkix (), "PKIX1.XmppAddr", &c2);
@@ -1029,15 +1030,27 @@ _gnutls_parse_general_name (ASN1_TYPE src, const char 
*src_name,
                  return _gnutls_asn2err (result);
                }
 
+             len = *name_size;
              result = asn1_read_value (c2, "", name, &len);
-             *name_size = len;
              if (result != ASN1_SUCCESS)
                {
                  gnutls_assert ();
                  asn1_delete_structure (&c2);
+                 *name_size = len + 1;
                  return _gnutls_asn2err (result);
                }
              asn1_delete_structure (&c2);
+
+             if (len + 1 > orig_name_size)
+               {
+                 gnutls_assert ();
+                 *name_size = len + 1;
+                 return GNUTLS_E_SHORT_MEMORY_BUFFER;
+               }
+
+             *name_size = len;
+             /* null terminate it */
+             ((char *) name)[*name_size] = 0;
            }
        }
     }


hooks/post-receive
-- 
GNU gnutls




reply via email to

[Prev in Thread] Current Thread [Next in Thread]