Patch for wrong size allocation in ne_gnutls.c

Henrik Holst henrik.holst at
Wed Nov 14 11:01:22 EST 2018


  ne_gnutls.c makes a malloc for the size of the pointer to the
gnutls_pcert_st structure instead of the size of the structure itself.

I also changed from malloc to calloc in case gnutls_pcert_import_x509()
reads from any of the structure members before filling it in (a bit unsure
about the requirements of the GnuTLS library).

I've attached the patch both inline and as an attached file since Gmail
(which I use) have a tendendency to bork inline patches:

---    2018-11-14 16:18:17.937532267 +0100
+++ ne_gnutls.c    2018-11-14 16:18:33.465205564 +0100
@@ -660,7 +660,7 @@
                 return ret;

-            *pcert = gnutls_malloc(sizeof *pcert);
+            *pcert = gnutls_calloc(1, sizeof **pcert);
sess->client_cert->cert.subject, 0);
             *pcert_length = 1;
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ne_gnutls.c.diff
Type: text/x-patch
Size: 469 bytes
Desc: not available
Url : 

More information about the neon mailing list