gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_2_9_3-55-g4c439e1


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_9_3-55-g4c439e1
Date: Mon, 31 Aug 2009 19:04:18 +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=4c439e1cae52209bb74df9a091d04f85de2223de

The branch, master has been updated
       via  4c439e1cae52209bb74df9a091d04f85de2223de (commit)
      from  3ebf20c5b4c5eb66f89952bd404850d160541adf (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 4c439e1cae52209bb74df9a091d04f85de2223de
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 2fa3c6b..a65626b 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]