Closed Bug 352514 Opened 19 years ago Closed 19 years ago

Possibly unsafe assignment in nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)

Categories

(Core :: Layout: Text and Fonts, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: kilowatt, Unassigned)

Details

(Whiteboard: [good first bug])

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060912 BonEcho/2.0b2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060912 BonEcho/2.0b2 in /cvsroot/mozilla/widget/src/windows/nsBidiKeyboard.cpp: NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL) { *aIsRTL = PR_FALSE; ... Since aIsRTL is a pointer to a variable, it should be checked against NULL before making any assignments to it. Reproducible: Always
The same goes for all the other implementations of nsBidiKeyboard too
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [good first bug]
Can do the others the same way if this is good
Attachment #238543 - Flags: review?
Comment on attachment 238543 [details] [diff] [review] Returns null pointer error if necessary before dereference This is the right fix, but please follow local style: insert a space after the "if" and put the return on a separate line. Please make that change, apply it to all the versions, attach a new patch and rerequest review.
Attachment #238543 - Attachment is obsolete: true
Attachment #238543 - Flags: review?
(In reply to comment #4) > (From update of attachment 238543 [details] [diff] [review] [edit]) > This is the right fix, but please follow local style: insert a space after the > "if" and put the return on a separate line. > > Please make that change, apply it to all the versions, attach a new patch and > rerequest review. > Will do, thanks
(In reply to comment #6) > Created an attachment (id=238684) [edit] > Patches all the nsBidiKeyboard.cpp files in widget/src to prevent dereferencing > null pointer > What about space between "if" and opening bracket?
Sorry for the earlier mistakes... that is what I get for copy pasting
Attachment #238684 - Attachment is obsolete: true
Attachment #238693 - Flags: review?
Attachment #238684 - Flags: review?
Comment on attachment 238693 [details] [diff] [review] Patches all the nsBidiKeyboard.cpp files in widget/src to prevent dereferencing null pointer with correct style Sorry, I meant to tell you in my last comment that you should specify who you are requesting review from. Otherwise the request may not get noticed. r=me.
Attachment #238693 - Flags: review? → review+
(In reply to comment #9) > (From update of attachment 238693 [details] [diff] [review] [edit]) > Sorry, I meant to tell you in my last comment that you should specify who you > are requesting review from. Otherwise the request may not get noticed. > > r=me. > Alright, thanks! Am I supposed to request super-review for this now?
(In reply to comment #10) > Alright, thanks! Am I supposed to request super-review for this now? > Yes. See http://www.mozilla.org/hacking/reviewers.html, but I think the super-reviewers listed there for widget/ aren't active. Try roc@ocallahan.org, who is module owner of widget/, or one of the "catch-all" super-reviewers.
(In reply to comment #11) > (In reply to comment #10) > > Alright, thanks! Am I supposed to request super-review for this now? > > > > Yes. See http://www.mozilla.org/hacking/reviewers.html, but I think the > super-reviewers listed there for widget/ aren't active. Try roc@ocallahan.org, > who is module owner of widget/, or one of the "catch-all" super-reviewers. > Will do, thanks
Attachment #238693 - Flags: superreview?(roc)
Comment on attachment 238693 [details] [diff] [review] Patches all the nsBidiKeyboard.cpp files in widget/src to prevent dereferencing null pointer with correct style Sorry, but I don't think we should check these for null. Yes, technically this is a public IDL interface and someone could script it and pass null and cause a crash from Javascript, which shouldn't happen. If that's the concern here then we should simply make nsIBidiKeyboard a C++-only interface in a .h file ... and then we would make IsLangRTL() just return a PRBool and there'd be no more null issue. But as is, I don't think this is worth doing. We know we're not going to pass in null.
Attachment #238693 - Flags: superreview?(roc) → superreview-
We should close bug then?
Yeah
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: layout.bidi → layout.fonts-and-text
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: