Closed Bug 825167 Opened 12 years ago Closed 12 years ago

[TSF] "ASSERTION: nsTDependentString must wrap only null-terminated strings: 'mData[mLength] == 0'" when composition string becomes 0 length

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: masayuki, Assigned: masayuki)

Details

(Keywords: inputmethod)

Attachments

(1 file)

No description provided.
Comment on attachment 696260 [details] [diff] [review] Patch At removing a character of composition string by backspace key, nsTextStore::SetText() may send composition string including the being removed character. Then, the pchText[cch] is not NULL character. nsDependentString doesn't assume such case (I'm not sure the reason since the constructor has the argument which can specify the length). We should use nsDependentSubstring instead.
Attachment #696260 - Flags: review?(jmathies)
Attachment #696260 - Flags: review?(jmathies) → review+
(In reply to Masayuki Nakano from comment #2) > nsDependentString doesn't assume such case (I'm not sure the reason since > the constructor has the argument which can specify the length). nsDependentString derives from nsCString which guarantees a null-terminated string. (Most people don't know the length of their string in advance, but there are some oddballs such as atoms which mess around with fake string buffers and suchlike.) > We should use nsDependentSubstring instead. Or you could also use Substring, which returns an nsDependentSubstring. (As with PromiseFlatString, I believe that it's preferred to use the function rather than the constructor, although not everyone remembers to do that.)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: