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)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: kilowatt, Unassigned)
Details
(Whiteboard: [good first bug])
Attachments
(1 file, 2 obsolete files)
7.10 KB,
patch
|
smontagu
:
review+
roc
:
superreview-
|
Details | Diff | Splinter Review |
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
Comment 1•19 years ago
|
||
The same goes for all the other implementations of nsBidiKeyboard too
Comment 2•19 years ago
|
||
http://lxr.mozilla.org/mozilla/source/widget/src/windows/nsBidiKeyboard.cpp#86
For those who may like a lxr linkup.
-- Ryan
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•19 years ago
|
Whiteboard: [good first bug]
Comment 3•19 years ago
|
||
Can do the others the same way if this is good
Attachment #238543 -
Flags: review?
Comment 4•19 years ago
|
||
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.
Updated•19 years ago
|
Attachment #238543 -
Attachment is obsolete: true
Attachment #238543 -
Flags: review?
Comment 5•19 years ago
|
||
(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
Comment 6•19 years ago
|
||
Attachment #238684 -
Flags: review?
Reporter | ||
Comment 7•19 years ago
|
||
(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?
Comment 8•19 years ago
|
||
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 9•19 years ago
|
||
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+
Comment 10•19 years ago
|
||
(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?
Comment 11•19 years ago
|
||
(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.
Comment 12•19 years ago
|
||
(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
Updated•19 years ago
|
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-
Comment 14•19 years ago
|
||
We should close bug then?
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.
Description
•