summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dom/base/nsDocument.cpp35
-rw-r--r--dom/base/nsDocument.h5
-rw-r--r--dom/base/nsPlainTextSerializer.cpp58
-rw-r--r--dom/base/nsPlainTextSerializer.h4
-rw-r--r--dom/canvas/test/reftest/filters/liveness-document-open.html46
-rw-r--r--dom/canvas/test/reftest/filters/reftest.list1
-rw-r--r--dom/plugins/ipc/PluginInstanceChild.cpp13
-rw-r--r--dom/workers/WorkerPrivate.cpp6
-rw-r--r--layout/generic/nsTextFrame.cpp3
-rw-r--r--media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h3
-rw-r--r--modules/libpref/init/all.js2
-rw-r--r--netwerk/base/ProxyAutoConfig.cpp26
-rw-r--r--security/nss/coreconf/coreconf.dep1
-rw-r--r--security/nss/lib/nss/nss.h4
-rw-r--r--security/nss/lib/softoken/pkcs11.c9
-rw-r--r--security/nss/lib/softoken/pkcs11c.c2
-rw-r--r--security/nss/lib/softoken/pkcs11i.h2
-rw-r--r--security/nss/lib/softoken/pkcs11u.c23
-rw-r--r--security/nss/lib/softoken/softkver.h4
-rw-r--r--security/nss/lib/util/nssutil.h4
-rw-r--r--widget/gtk/nsClipboard.cpp4
21 files changed, 174 insertions, 81 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index 6b8e11db0..e2be6b664 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -395,6 +395,21 @@ nsIdentifierMapEntry::FireChangeCallbacks(Element* aOldElement,
}
}
+void
+nsIdentifierMapEntry::ClearAndNotify()
+{
+ Element* currentElement = mIdContentList.SafeElementAt(0);
+ mIdContentList.Clear();
+ if (currentElement) {
+ FireChangeCallbacks(currentElement, nullptr);
+ }
+ mNameContentList = nullptr;
+ if (mImageElement) {
+ SetImageElement(nullptr);
+ }
+ mChangeCallbacks = nullptr;
+}
+
namespace {
struct PositionComparator
@@ -1422,12 +1437,12 @@ nsDocument::~nsDocument()
delete mSubDocuments;
mSubDocuments = nullptr;
+ nsAutoScriptBlocker scriptBlocker;
+
// Destroy link map now so we don't waste time removing
// links one by one
DestroyElementMaps();
- nsAutoScriptBlocker scriptBlocker;
-
for (uint32_t indx = mChildren.ChildCount(); indx-- != 0; ) {
mChildren.ChildAt(indx)->UnbindFromTree();
mChildren.RemoveChildAt(indx);
@@ -1972,15 +1987,16 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
delete mSubDocuments;
mSubDocuments = nullptr;
- // Destroy link map now so we don't waste time removing
- // links one by one
- DestroyElementMaps();
-
bool oldVal = mInUnlinkOrDeletion;
mInUnlinkOrDeletion = true;
uint32_t count = mChildren.ChildCount();
{ // Scope for update
MOZ_AUTO_DOC_UPDATE(this, UPDATE_CONTENT_MODEL, true);
+
+ // Destroy link map now so we don't waste time removing
+ // links one by one
+ DestroyElementMaps();
+
for (int32_t i = int32_t(count) - 1; i >= 0; i--) {
nsCOMPtr<nsIContent> content = mChildren.ChildAt(i);
@@ -8955,7 +8971,14 @@ nsDocument::DestroyElementMaps()
mStyledLinksCleared = true;
#endif
mStyledLinks.Clear();
+
+ // Notify ID change listeners before clearing the identifier map.
+ for (auto iter = mIdentifierMap.Iter(); !iter.Done(); iter.Next()) {
+ iter.Get()->ClearAndNotify();
+ }
+
mIdentifierMap.Clear();
+
++mExpandoAndGeneration.generation;
}
diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h
index 2b29b98fa..ac600eb43 100644
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -216,6 +216,11 @@ public:
void RemoveContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
void* aData, bool aForImage);
+ /**
+ * Remove all elements and notify change listeners.
+ */
+ void ClearAndNotify();
+
void Traverse(nsCycleCollectionTraversalCallback* aCallback);
struct ChangeCallback {
diff --git a/dom/base/nsPlainTextSerializer.cpp b/dom/base/nsPlainTextSerializer.cpp
index 8097c4ec8..98c9cfe32 100644
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -53,7 +53,6 @@ static int32_t GetUnicharStringWidth(const char16_t* pwcs, int32_t n);
// Someday may want to make this non-const:
static const uint32_t TagStackSize = 500;
-static const uint32_t OLStackSize = 100;
nsresult
NS_NewPlainTextSerializer(nsIContentSerializer** aSerializer)
@@ -100,10 +99,6 @@ nsPlainTextSerializer::nsPlainTextSerializer()
mTagStackIndex = 0;
mIgnoreAboveIndex = (uint32_t)kNotFound;
- // initialize the OL stack, where numbers for ordered lists are kept
- mOLStack = new int32_t[OLStackSize];
- mOLStackIndex = 0;
-
mULCount = 0;
mIgnoredChildNodeLevel = 0;
@@ -112,7 +107,6 @@ nsPlainTextSerializer::nsPlainTextSerializer()
nsPlainTextSerializer::~nsPlainTextSerializer()
{
delete[] mTagStack;
- delete[] mOLStack;
NS_WARNING_ASSERTION(mHeadLevel == 0, "Wrong head level!");
}
@@ -189,6 +183,8 @@ nsPlainTextSerializer::Init(uint32_t aFlags, uint32_t aWrapColumn,
// XXX We should let the caller decide whether to do this or not
mFlags &= ~nsIDocumentEncoder::OutputNoFramesContent;
+ MOZ_ASSERT(mOLStack.IsEmpty());
+
return NS_OK;
}
@@ -438,6 +434,8 @@ nsPlainTextSerializer::AppendDocumentStart(nsIDocument *aDocument,
return NS_OK;
}
+int32_t kOlStackDummyValue = 0;
+
nsresult
nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag)
{
@@ -616,44 +614,45 @@ nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag)
}
else if (aTag == nsGkAtoms::ul) {
// Indent here to support nested lists, which aren't included in li :-(
- EnsureVerticalSpace(mULCount + mOLStackIndex == 0 ? 1 : 0);
- // Must end the current line before we change indention
+ EnsureVerticalSpace(IsInOLOrUL() ? 0 : 1);
+ // Must end the current line before we change indention
mIndent += kIndentSizeList;
mULCount++;
}
else if (aTag == nsGkAtoms::ol) {
- EnsureVerticalSpace(mULCount + mOLStackIndex == 0 ? 1 : 0);
+ EnsureVerticalSpace(IsInOLOrUL() ? 0 : 1);
if (mFlags & nsIDocumentEncoder::OutputFormatted) {
// Must end the current line before we change indention
- if (mOLStackIndex < OLStackSize) {
- nsAutoString startAttr;
- int32_t startVal = 1;
- if (NS_SUCCEEDED(GetAttributeValue(nsGkAtoms::start, startAttr))) {
- nsresult rv = NS_OK;
- startVal = startAttr.ToInteger(&rv);
- if (NS_FAILED(rv))
- startVal = 1;
+ nsAutoString startAttr;
+ int32_t startVal = 1;
+ if (NS_SUCCEEDED(GetAttributeValue(nsGkAtoms::start, startAttr))) {
+ nsresult rv = NS_OK;
+ startVal = startAttr.ToInteger(&rv);
+ if (NS_FAILED(rv)) {
+ startVal = 1;
}
- mOLStack[mOLStackIndex++] = startVal;
}
+ mOLStack.AppendElement(startVal);
} else {
- mOLStackIndex++;
+ mOLStack.AppendElement(kOlStackDummyValue);
}
mIndent += kIndentSizeList; // see ul
}
else if (aTag == nsGkAtoms::li &&
(mFlags & nsIDocumentEncoder::OutputFormatted)) {
if (mTagStackIndex > 1 && IsInOL()) {
- if (mOLStackIndex > 0) {
+ if (!mOLStack.IsEmpty()) {
nsAutoString valueAttr;
if (NS_SUCCEEDED(GetAttributeValue(nsGkAtoms::value, valueAttr))) {
nsresult rv = NS_OK;
int32_t valueAttrVal = valueAttr.ToInteger(&rv);
- if (NS_SUCCEEDED(rv))
- mOLStack[mOLStackIndex-1] = valueAttrVal;
+ if (NS_SUCCEEDED(rv)) {
+ mOLStack.LastElement() = valueAttrVal;
+ }
}
// This is what nsBulletFrame does for OLs:
- mInIndentString.AppendInt(mOLStack[mOLStackIndex-1]++, 10);
+ mInIndentString.AppendInt(mOLStack.LastElement(), 10);
+ mOLStack.LastElement()++;
}
else {
mInIndentString.Append(char16_t('#'));
@@ -878,7 +877,8 @@ nsPlainTextSerializer::DoCloseContainer(nsIAtom* aTag)
else if (aTag == nsGkAtoms::ul) {
FlushLine();
mIndent -= kIndentSizeList;
- if (--mULCount + mOLStackIndex == 0) {
+ --mULCount;
+ if (!IsInOLOrUL()) {
mFloatingLines = 1;
mLineBreakDue = true;
}
@@ -886,9 +886,9 @@ nsPlainTextSerializer::DoCloseContainer(nsIAtom* aTag)
else if (aTag == nsGkAtoms::ol) {
FlushLine(); // Doing this after decreasing OLStackIndex would be wrong.
mIndent -= kIndentSizeList;
- NS_ASSERTION(mOLStackIndex, "Wrong OLStack level!");
- mOLStackIndex--;
- if (mULCount + mOLStackIndex == 0) {
+ NS_ASSERTION(!mOLStack.IsEmpty(), "Wrong OLStack level!");
+ mOLStack.RemoveElementAt(mOLStack.Length() - 1);
+ if (!IsInOLOrUL()) {
mFloatingLines = 1;
mLineBreakDue = true;
}
@@ -1861,6 +1861,10 @@ nsPlainTextSerializer::IsInOL()
return false;
}
+bool nsPlainTextSerializer::IsInOLOrUL() const {
+ return (mULCount > 0) || !mOLStack.IsEmpty();
+}
+
/*
@return 0 = no header, 1 = h1, ..., 6 = h6
*/
diff --git a/dom/base/nsPlainTextSerializer.h b/dom/base/nsPlainTextSerializer.h
index 5055c75a0..650a8e3e7 100644
--- a/dom/base/nsPlainTextSerializer.h
+++ b/dom/base/nsPlainTextSerializer.h
@@ -81,6 +81,7 @@ private:
void Write(const nsAString& aString);
bool IsInPre();
bool IsInOL();
+ bool IsInOLOrUL() const;
bool IsCurrentNodeConverted();
bool MustSuppressLeaf();
@@ -218,8 +219,7 @@ private:
uint32_t mIgnoreAboveIndex;
// The stack for ordered lists
- int32_t *mOLStack;
- uint32_t mOLStackIndex;
+ AutoTArray<int32_t, 100> mOLStack;
uint32_t mULCount;
diff --git a/dom/canvas/test/reftest/filters/liveness-document-open.html b/dom/canvas/test/reftest/filters/liveness-document-open.html
new file mode 100644
index 000000000..b3d76e550
--- /dev/null
+++ b/dom/canvas/test/reftest/filters/liveness-document-open.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<title>canvas filters: remove referenced filter element through document.open()</title>
+
+<body onload="loaded()">
+
+<canvas id="canvas" width="10" height="10"></canvas>
+
+<svg height="0">
+ <filter id="filter">
+ <feFlood flood-color="red"/>
+ </filter>
+</svg>
+
+<script>
+
+function loaded() {
+ var ctx = document.getElementById('canvas').getContext('2d');
+
+ ctx.filter = 'url(#filter)';
+ ctx.fillRect(0, 0, 10, 10); // do a draw first to work around bug 1287316
+
+ document.open();
+
+ // The document.open() call removed #filter from the document. So the filter
+ // reference should now be invalid, and the rect should be drawn without a
+ // filter applied, resulting in black.
+ ctx.fillRect(0, 0, 10, 10);
+
+ try {
+ var data = ctx.getImageData(0, 0, 1, 1).data;
+ if (data[0] == 0 && data[1] == 0 && data[2] == 0 && data[3] == 255) {
+ // Successfully painted black.
+ document.write('PASS');
+ } else {
+ // Painted something else, like red.
+ document.write('FAIL');
+ }
+ } catch (e) {
+ document.write('getImageData failed');
+ }
+ document.close();
+}
+
+</script>
diff --git a/dom/canvas/test/reftest/filters/reftest.list b/dom/canvas/test/reftest/filters/reftest.list
index 983030715..f5d671e4d 100644
--- a/dom/canvas/test/reftest/filters/reftest.list
+++ b/dom/canvas/test/reftest/filters/reftest.list
@@ -6,6 +6,7 @@ default-preferences pref(canvas.filters.enabled,true)
fuzzy-if(azureSkia,1,1500) == global-alpha.html global-alpha-ref.html
== global-composite-operation.html global-composite-operation-ref.html
== liveness.html ref.html
+== liveness-document-open.html data:text/html,PASS
== multiple-drop-shadows.html shadow-ref.html
== shadow.html shadow-ref.html
== subregion-fill-paint.html subregion-ref.html
diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
index af9db9103..3f2cdbc13 100644
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -310,9 +310,10 @@ PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
switch (aValue) {
case NPNVWindowNPObject:
if (!(actor = mCachedWindowActor)) {
+ result = NPERR_GENERIC_ERROR;
PPluginScriptableObjectChild* actorProtocol;
- CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result);
- if (result == NPERR_NO_ERROR) {
+ if (CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result) &&
+ result == NPERR_NO_ERROR) {
actor = mCachedWindowActor =
static_cast<PluginScriptableObjectChild*>(actorProtocol);
NS_ASSERTION(actor, "Null actor!");
@@ -324,10 +325,10 @@ PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
case NPNVPluginElementNPObject:
if (!(actor = mCachedElementActor)) {
+ result = NPERR_GENERIC_ERROR;
PPluginScriptableObjectChild* actorProtocol;
- CallNPN_GetValue_NPNVPluginElementNPObject(&actorProtocol,
- &result);
- if (result == NPERR_NO_ERROR) {
+ if (CallNPN_GetValue_NPNVPluginElementNPObject(&actorProtocol, &result) &&
+ result == NPERR_NO_ERROR) {
actor = mCachedElementActor =
static_cast<PluginScriptableObjectChild*>(actorProtocol);
NS_ASSERTION(actor, "Null actor!");
@@ -338,6 +339,7 @@ PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
break;
default:
+ result = NPERR_GENERIC_ERROR;
NS_NOTREACHED("Don't know what to do with this value type!");
}
@@ -434,6 +436,7 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar,
case NPNVWindowNPObject: // Intentional fall-through
case NPNVPluginElementNPObject: {
NPObject* object;
+ *((NPObject**)aValue) = nullptr;
NPError result = InternalGetNPObjectForValue(aVar, &object);
if (result == NPERR_NO_ERROR) {
*((NPObject**)aValue) = object;
diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
index 27eb570e9..c6ef21f2c 100644
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -2543,6 +2543,12 @@ WorkerPrivateParent<Derived>::DisableDebugger()
WorkerPrivate* self = ParentAsWorkerPrivate();
+ // RegisterDebugger might have been dispatched but not completed.
+ // Wait for its execution to complete before unregistering.
+ if (!NS_IsMainThread()) {
+ self->WaitForIsDebuggerRegistered(true);
+ }
+
if (NS_FAILED(UnregisterWorkerDebugger(self))) {
NS_WARNING("Failed to unregister worker debugger!");
}
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index 0641c7439..59ef020ce 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -7525,7 +7525,8 @@ nsTextFrame::GetCharacterRectsInRange(int32_t aInOffset,
gfxSkipCharsIterator nextIter(iter);
nextIter.AdvanceOriginal(1);
if (!nextIter.IsOriginalCharSkipped() &&
- !mTextRun->IsClusterStart(nextIter.GetSkippedOffset())) {
+ !mTextRun->IsClusterStart(nextIter.GetSkippedOffset()) &&
+ nextIter.GetOriginalOffset() < kContentEnd) {
FindClusterEnd(mTextRun, kContentEnd, &nextIter);
}
diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
index 1dcc70519..6229e1c95 100644
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -530,7 +530,8 @@ public:
void GetFingerprint(nsAString& fingerprint)
{
char *tmp;
- GetFingerprint(&tmp);
+ nsresult rv = GetFingerprint(&tmp);
+ NS_ENSURE_SUCCESS_VOID(rv);
fingerprint.AssignASCII(tmp);
delete[] tmp;
}
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index f7c047e92..96ebe0990 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -23,7 +23,7 @@ pref("keyword.enabled", false);
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
pref("general.useragent.compatMode.gecko", false);
pref("general.useragent.compatMode.firefox", false);
-pref("general.useragent.compatMode.version", "60.9");
+pref("general.useragent.compatMode.version", "68.9");
pref("general.useragent.appVersionIsBuildID", false);
// This pref exists only for testing purposes. In order to disable all
diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp
index 4d7a6c1fd..6a9577669 100644
--- a/netwerk/base/ProxyAutoConfig.cpp
+++ b/netwerk/base/ProxyAutoConfig.cpp
@@ -271,6 +271,7 @@ public:
PACResolver()
: mStatus(NS_ERROR_FAILURE)
+ , mMutex("PACResolver::Mutex")
{
}
@@ -279,9 +280,15 @@ public:
nsIDNSRecord *record,
nsresult status) override
{
- if (mTimer) {
- mTimer->Cancel();
- mTimer = nullptr;
+ nsCOMPtr<nsITimer> timer;
+ {
+ MutexAutoLock lock(mMutex);
+ timer.swap(mTimer);
+ mRequest = nullptr;
+ }
+
+ if (timer) {
+ timer->Cancel();
}
mRequest = nullptr;
@@ -293,9 +300,15 @@ public:
// nsITimerCallback
NS_IMETHOD Notify(nsITimer *timer) override
{
- if (mRequest)
- mRequest->Cancel(NS_ERROR_NET_TIMEOUT);
- mTimer = nullptr;
+ nsCOMPtr<nsICancelable> request;
+ {
+ MutexAutoLock lock(mMutex);
+ request.swap(mRequest);
+ mTimer = nullptr;
+ }
+ if (request) {
+ request->Cancel(NS_ERROR_NET_TIMEOUT);
+ }
return NS_OK;
}
@@ -303,6 +316,7 @@ public:
nsCOMPtr<nsICancelable> mRequest;
nsCOMPtr<nsIDNSRecord> mResponse;
nsCOMPtr<nsITimer> mTimer;
+ Mutex mMutex;
private:
~PACResolver() {}
diff --git a/security/nss/coreconf/coreconf.dep b/security/nss/coreconf/coreconf.dep
index 590d1bfae..4634c4885 100644
--- a/security/nss/coreconf/coreconf.dep
+++ b/security/nss/coreconf/coreconf.dep
@@ -11,3 +11,4 @@
#error "Do not include this header file."
+
diff --git a/security/nss/lib/nss/nss.h b/security/nss/lib/nss/nss.h
index f6b83a01c..9a443c36c 100644
--- a/security/nss/lib/nss/nss.h
+++ b/security/nss/lib/nss/nss.h
@@ -22,10 +22,10 @@
* The format of the version string should be
* "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
*/
-#define NSS_VERSION "3.41.3" _NSS_CUSTOMIZED
+#define NSS_VERSION "3.41.4" _NSS_CUSTOMIZED
#define NSS_VMAJOR 3
#define NSS_VMINOR 41
-#define NSS_VPATCH 3
+#define NSS_VPATCH 4
#define NSS_VBUILD 0
#define NSS_BETA PR_FALSE
diff --git a/security/nss/lib/softoken/pkcs11.c b/security/nss/lib/softoken/pkcs11.c
index 7dd4f7ee9..7f0adf82f 100644
--- a/security/nss/lib/softoken/pkcs11.c
+++ b/security/nss/lib/softoken/pkcs11.c
@@ -2674,8 +2674,9 @@ sftk_CloseAllSessions(SFTKSlot *slot, PRBool logout)
} else {
SKIP_AFTER_FORK(PZ_Unlock(lock));
}
- if (session)
- sftk_FreeSession(session);
+ if (session) {
+ sftk_DestroySession(session);
+ }
} while (session != NULL);
}
return CKR_OK;
@@ -3910,8 +3911,6 @@ NSC_CloseSession(CK_SESSION_HANDLE hSession)
if (sftkqueue_is_queued(session, hSession, slot->head, slot->sessHashSize)) {
sessionFound = PR_TRUE;
sftkqueue_delete(session, hSession, slot->head, slot->sessHashSize);
- session->refCount--; /* can't go to zero while we hold the reference */
- PORT_Assert(session->refCount > 0);
}
PZ_Unlock(lock);
@@ -3932,6 +3931,8 @@ NSC_CloseSession(CK_SESSION_HANDLE hSession)
if (session->info.flags & CKF_RW_SESSION) {
(void)PR_ATOMIC_DECREMENT(&slot->rwSessionCount);
}
+ sftk_DestroySession(session);
+ session = NULL;
}
sftk_FreeSession(session);
diff --git a/security/nss/lib/softoken/pkcs11c.c b/security/nss/lib/softoken/pkcs11c.c
index 327a67d5c..4837961f1 100644
--- a/security/nss/lib/softoken/pkcs11c.c
+++ b/security/nss/lib/softoken/pkcs11c.c
@@ -1285,7 +1285,7 @@ NSC_EncryptUpdate(CK_SESSION_HANDLE hSession,
}
/* encrypt the current padded data */
rv = (*context->update)(context->cipherInfo, pEncryptedPart,
- &padoutlen, context->blockSize, context->padBuf,
+ &padoutlen, maxout, context->padBuf,
context->blockSize);
if (rv != SECSuccess) {
return sftk_MapCryptError(PORT_GetError());
diff --git a/security/nss/lib/softoken/pkcs11i.h b/security/nss/lib/softoken/pkcs11i.h
index 7e57dc5e5..1ba0bdb82 100644
--- a/security/nss/lib/softoken/pkcs11i.h
+++ b/security/nss/lib/softoken/pkcs11i.h
@@ -281,7 +281,6 @@ struct SFTKSessionStr {
SFTKSession *next;
SFTKSession *prev;
CK_SESSION_HANDLE handle;
- int refCount;
PZLock *objectLock;
int objectIDCount;
CK_SESSION_INFO info;
@@ -670,6 +669,7 @@ extern SFTKSlot *sftk_SlotFromSessionHandle(CK_SESSION_HANDLE handle);
extern CK_SLOT_ID sftk_SlotIDFromSessionHandle(CK_SESSION_HANDLE handle);
extern SFTKSession *sftk_SessionFromHandle(CK_SESSION_HANDLE handle);
extern void sftk_FreeSession(SFTKSession *session);
+extern void sftk_DestroySession(SFTKSession *session);
extern SFTKSession *sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify,
CK_VOID_PTR pApplication, CK_FLAGS flags);
extern void sftk_update_state(SFTKSlot *slot, SFTKSession *session);
diff --git a/security/nss/lib/softoken/pkcs11u.c b/security/nss/lib/softoken/pkcs11u.c
index 7b5fe732f..8cb5d2e70 100644
--- a/security/nss/lib/softoken/pkcs11u.c
+++ b/security/nss/lib/softoken/pkcs11u.c
@@ -1772,7 +1772,6 @@ sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify, CK_VOID_PTR pApplication,
return NULL;
session->next = session->prev = NULL;
- session->refCount = 1;
session->enc_context = NULL;
session->hash_context = NULL;
session->sign_context = NULL;
@@ -1796,11 +1795,10 @@ sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify, CK_VOID_PTR pApplication,
}
/* free all the data associated with a session. */
-static void
+void
sftk_DestroySession(SFTKSession *session)
{
SFTKObjectList *op, *next;
- PORT_Assert(session->refCount == 0);
/* clean out the attributes */
/* since no one is referencing us, it's safe to walk the chain
@@ -1844,31 +1842,20 @@ sftk_SessionFromHandle(CK_SESSION_HANDLE handle)
PZ_Lock(lock);
sftkqueue_find(session, handle, slot->head, slot->sessHashSize);
- if (session)
- session->refCount++;
PZ_Unlock(lock);
return (session);
}
/*
- * release a reference to a session handle
+ * release a reference to a session handle. This method of using SFTKSessions
+ * is deprecated, but the pattern should be retained until a future effort
+ * to refactor all SFTKSession users at once is completed.
*/
void
sftk_FreeSession(SFTKSession *session)
{
- PRBool destroy = PR_FALSE;
- SFTKSlot *slot = sftk_SlotFromSession(session);
- PZLock *lock = SFTK_SESSION_LOCK(slot, session->handle);
-
- PZ_Lock(lock);
- if (session->refCount == 1)
- destroy = PR_TRUE;
- session->refCount--;
- PZ_Unlock(lock);
-
- if (destroy)
- sftk_DestroySession(session);
+ return;
}
void
diff --git a/security/nss/lib/softoken/softkver.h b/security/nss/lib/softoken/softkver.h
index ab2e91018..3c1842f6e 100644
--- a/security/nss/lib/softoken/softkver.h
+++ b/security/nss/lib/softoken/softkver.h
@@ -17,10 +17,10 @@
* The format of the version string should be
* "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
*/
-#define SOFTOKEN_VERSION "3.41.3" SOFTOKEN_ECC_STRING
+#define SOFTOKEN_VERSION "3.41.4" SOFTOKEN_ECC_STRING
#define SOFTOKEN_VMAJOR 3
#define SOFTOKEN_VMINOR 41
-#define SOFTOKEN_VPATCH 3
+#define SOFTOKEN_VPATCH 4
#define SOFTOKEN_VBUILD 0
#define SOFTOKEN_BETA PR_FALSE
diff --git a/security/nss/lib/util/nssutil.h b/security/nss/lib/util/nssutil.h
index f880fb55e..44226cfeb 100644
--- a/security/nss/lib/util/nssutil.h
+++ b/security/nss/lib/util/nssutil.h
@@ -19,10 +19,10 @@
* The format of the version string should be
* "<major version>.<minor version>[.<patch level>[.<build number>]][ <Beta>]"
*/
-#define NSSUTIL_VERSION "3.41.3"
+#define NSSUTIL_VERSION "3.41.4"
#define NSSUTIL_VMAJOR 3
#define NSSUTIL_VMINOR 41
-#define NSSUTIL_VPATCH 3
+#define NSSUTIL_VPATCH 4
#define NSSUTIL_VBUILD 0
#define NSSUTIL_BETA PR_FALSE
diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp
index eecae3e88..950be1dc4 100644
--- a/widget/gtk/nsClipboard.cpp
+++ b/widget/gtk/nsClipboard.cpp
@@ -806,7 +806,7 @@ void GetHTMLCharset(guchar * data, int32_t dataLength, nsCString& str)
static void
DispatchSelectionNotifyEvent(GtkWidget *widget, XEvent *xevent)
{
- GdkEvent event;
+ GdkEvent event = {};
event.selection.type = GDK_SELECTION_NOTIFY;
event.selection.window = gtk_widget_get_window(widget);
event.selection.selection = gdk_x11_xatom_to_atom(xevent->xselection.selection);
@@ -822,7 +822,7 @@ DispatchPropertyNotifyEvent(GtkWidget *widget, XEvent *xevent)
{
GdkWindow *window = gtk_widget_get_window(widget);
if ((gdk_window_get_events(window)) & GDK_PROPERTY_CHANGE_MASK) {
- GdkEvent event;
+ GdkEvent event = {};
event.property.type = GDK_PROPERTY_NOTIFY;
event.property.window = window;
event.property.atom = gdk_x11_xatom_to_atom(xevent->xproperty.atom);