Bug 1601389 - Fix invalid-memory access in LDAP search. r+a=jorgk THUNDERBIRD_72_0b2_BUILD1 THUNDERBIRD_72_0b2_RELEASE
authorBen Campbell <benc@thunderbird.net>
Mon, 09 Dec 2019 10:44:47 +1300
changeset 36779 366d146a024904deb432103a766a1a06adf59aef
parent 36778 412e2b0c774060a9e4417587878f371855234e5d
child 36780 3d86d4ec6230969333b6c9ca031bb9d6aec34dda
push id2537
push usergeoff@darktrojan.net
push dateThu, 12 Dec 2019 01:46:36 +0000
treeherdercomm-beta@366d146a0249 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1601389
Bug 1601389 - Fix invalid-memory access in LDAP search. r+a=jorgk
ldap/xpcom/src/nsLDAPOperation.cpp
--- a/ldap/xpcom/src/nsLDAPOperation.cpp
+++ b/ldap/xpcom/src/nsLDAPOperation.cpp
@@ -471,16 +471,17 @@ class SearchExtRunnable : public OpRunna
         mAttrs(aAttrs),
         mServerctls(aServerctls),
         mClientctls(aClientctls),
         mSizeLimit(aSizeLimit) {}
   virtual ~SearchExtRunnable() {
     // clean up
     ldap_controls_free(mServerctls);
     ldap_controls_free(mClientctls);
+    if (!mAttrs) return;
     // The last attr entry is null, so no need to free that.
     int numAttrs = 0;
     while (mAttrs[numAttrs]) {
       ++numAttrs;
     }
     NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(numAttrs, mAttrs);
   }