[Libreoffice-commits] core.git: external/nss

Stephan Bergmann sbergman at redhat.com
Mon Aug 22 13:39:07 UTC 2016


 external/nss/ubsan.patch.0 |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

New commits:
commit 87c271d4a9c373ea13bd682945c1cc8a9ac52bea
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 22 15:35:11 2016 +0200

    Silence -fsanitize=array-bounds in external/nss
    
    ...by making lgdbDataStr::names a "by-convention flexible array member".
    Otherwise, e.g. CppunitTest_xmlsecurity_signing_test fails with "index 30 out of
    bounds for type 'unsigned char [6]'".
    
    Change-Id: Ie5bf4199b8b49090a987143d355754a69512e309

diff --git a/external/nss/ubsan.patch.0 b/external/nss/ubsan.patch.0
index 70d4af8..1cdf694 100644
--- a/external/nss/ubsan.patch.0
+++ b/external/nss/ubsan.patch.0
@@ -9,3 +9,32 @@
  
      if (cache->ncrls) {
          /* pick the newest CRL */
+--- nss/lib/softoken/legacydb/pk11db.c
++++ nss/lib/softoken/legacydb/pk11db.c
+@@ -58,7 +58,7 @@
+     unsigned char isModuleDBOnly;
+     unsigned char isCritical;
+     unsigned char reserved[4];
+-    unsigned char names[6];	/* enough space for the length fields */
++    unsigned char names[1];	/* +5: enough space for the length fields */
+ };
+ 
+ struct lgdbSlotDataStr {
+@@ -139,7 +139,7 @@
+ 	goto loser;
+     }
+ 
+-    dataLen = sizeof(lgdbData) + len + len2 + len3 + sizeof(unsigned short) +
++    dataLen = sizeof(lgdbData)+5 + len + len2 + len3 + sizeof(unsigned short) +
+ 				 count*sizeof(lgdbSlotData);
+ 
+     data->data = (unsigned char *) PORT_ZAlloc(dataLen);
+@@ -319,7 +319,7 @@
+     }
+     if ((encoded->major == LGDB_DB_EXT1_VERSION_MAJOR) &&
+ 	(encoded->minor >= LGDB_DB_EXT1_VERSION_MINOR)) {
+-	CHECK_SIZE( sizeof(lgdbData));
++	CHECK_SIZE( sizeof(lgdbData)+5);
+ 	trustOrder     = LGDB_GETLONG(encoded->trustOrder);
+ 	cipherOrder    = LGDB_GETLONG(encoded->cipherOrder);
+ 	isModuleDB     = (encoded->isModuleDB != 0) ? PR_TRUE: PR_FALSE;


More information about the Libreoffice-commits mailing list