Passing incorrect arg to nsAWritableString::Mid

VERIFIED FIXED in mozilla0.9.2

Status

()

Core
Editor
P3
normal
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: Akkana Peck, Assigned: Joe Francis)

Tracking

Trunk
mozilla0.9.2
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Mid's last argument is unsigned, so passing -1 to it is likely to give
unpredictable results and probably won't return whatever was actually intended.

nsHTMLEditor::CreateDOMFragmentFromPaste (nsIDOMNSRange *, const 
nsString &, const nsString &, const nsString &, nsCOMPtr<nsIDOMNode> *, 
PRInt32 *, PRInt32 *)':
nsHTMLDataTransfer.cpp:1557: warning: passing negative value 
`-100000000' for argument 3 of `basic_nsAReadableString<CharT>::Mid 
(basic_nsAWritableString<CharT> &, unsigned int, unsigned int) const 
[with CharT = PRUnichar]'
(Assignee)

Comment 1

17 years ago
this bug has a *negative* tone.  am I to take that as a *sign*?
sorry...sorry.. the writers responsible for the above have been sacked.
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.1
(Assignee)

Updated

17 years ago
Target Milestone: mozilla0.9.1 → mozilla0.9.2
(Reporter)

Comment 2

17 years ago
I fixed this as part of another checkin.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 3

17 years ago
Joe/Akkana, can you verify this one? thanks.
(Reporter)

Comment 4

17 years ago
I did a grep for Mid in editor/base and found only one instance:
    tempString.Mid(runStr, runStart, runEnd-runStart);
which doesn't exhibit the problem.  Marking verified.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Reporter)

Comment 5

17 years ago
Somehow, that last change reopened instead of verifying.  
Status: REOPENED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 6

17 years ago
Trying again to verify.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.