helpGnuTLS - Support: sr #107831, local 'len' in...


sr #107831: local 'len' in gnutls_x509_crt_get_key_id not initialized, causing segmentation fault

Submitted by:  None
Submitted on:  Wed 05 Oct 2011 06:45:11 PM UTC  
Category:  Core library Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 05 Oct 2011 07:16:49 PM UTC, comment #2: 

It was, yes.

Wed 05 Oct 2011 07:12:43 PM UTC, comment #1: 

Thanks. It will be fixed in the next release. Was it an ECDSA key you were generating?

Nikos Mavrogiannopoulos <nmav>
Project Administrator
Wed 05 Oct 2011 06:45:11 PM UTC, original submission:  

With gnutls 3.0.3, certtool segfaults when I try to generate a self-signed certificate. The problem is that

asn1_der_coding (crt->cert, "tbsCertificate.subjectPublicKeyInfo", NULL, &len, NULL);

is called with len unitialized. Since len contains garbage, asn1_der_coding thinks it is okay to write to the output buffer, which is NULL. The following patch fixes the problem for me.

--- gnutls-3.0.3/lib/x509/x509.c.orig        2011-10-05 17:25:53.025852307 +0000
+++ gnutls-3.0.3/lib/x509/x509.c        2011-10-05 17:26:04.232713442 +0000
@@ -2283,7 +2283,7 @@
                             unsigned char *output_data,
                             size_t * output_data_size)
-  int pk, result = 0, len;
+  int pk, result = 0, len = 0;
   gnutls_datum_t pubkey;

   if (crt == NULL)



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by nmav (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-23 nmav StatusNone => Done
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.7