Closed Bug 1464890 Opened 6 years ago Closed 6 years ago

Use integers instead of raw pointer values as PRemoteSpellCheck IDs

Categories

(Core :: Spelling checker, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
RemoteSpellCheckEngineChild uses pointer values from its process as IPDL identifiers, which is causing problems with Web Replay as in a replaying process the pointer values will be reproduced exactly and are unsafe to dereference. The attached patch changes things to use integer identifiers instead.
Attachment #8981230 - Flags: review?(ehsan)
Component: General → Spelling checker
Comment on attachment 8981230 [details] [diff] [review] patch Review of attachment 8981230 [details] [diff] [review]: ----------------------------------------------------------------- ::: extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp @@ +58,3 @@ > } > + mResponsePromises[aId] = nullptr; > + while (mResponsePromises.Length() && !mResponsePromises.LastElement()) { Hmm, is the loop condition right here? It seems to me that if aId points to the last element in mResponsePromises, this loop would do the wrong thing, because in the first iteration, mResponsePromises.LastElement() would return nullptr and we would never enter the body of the loop. r=me with this fixed or explained in case I'm missing something.
Attachment #8981230 - Flags: review?(ehsan) → review+
(In reply to :Ehsan Akhgari from comment #1) > Comment on attachment 8981230 [details] [diff] [review] > patch > > Review of attachment 8981230 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp > @@ +58,3 @@ > > } > > + mResponsePromises[aId] = nullptr; > > + while (mResponsePromises.Length() && !mResponsePromises.LastElement()) { > > Hmm, is the loop condition right here? It seems to me that if aId points to > the last element in mResponsePromises, this loop would do the wrong thing, > because in the first iteration, mResponsePromises.LastElement() would return > nullptr and we would never enter the body of the loop. > > r=me with this fixed or explained in case I'm missing something. The loop condition tests !mResponsePromises.LastElement(), so we should only enter the loop and remove old entries if the last entry has been null'ed out.
Priority: -- → P3
Pushed by bhackett@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/ff3c10d0cc05 Use integers instead of raw pointer values as PRemoteSpellCheck IDs, r=ehsan.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Assignee: nobody → bhackett1024
Depends on: 1477540
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: