Closed Bug 68743 Opened 24 years ago Closed 23 years ago

Passing incorrect arg to nsAWritableString::Mid

Categories

(Core :: DOM: Editor, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: akkzilla, Assigned: mozeditor)

Details

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]'
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
Target Milestone: mozilla0.9.1 → mozilla0.9.2
I fixed this as part of another checkin.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Joe/Akkana, can you verify this one? thanks.
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 → ---
Somehow, that last change reopened instead of verifying.  
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Trying again to verify.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.