diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-08-22 15:35:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-08-22 15:35:11 +0200 |
commit | 87c271d4a9c373ea13bd682945c1cc8a9ac52bea (patch) | |
tree | 6ef2db2964b9d21a8610ae77aafd8186dcdeee36 /external/nss | |
parent | 72b621444a207405586876f015d4b32fab8cfc88 (diff) |
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
Diffstat (limited to 'external/nss')
-rw-r--r-- | external/nss/ubsan.patch.0 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/external/nss/ubsan.patch.0 b/external/nss/ubsan.patch.0 index 70d4af89ff19..1cdf694f4345 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; |