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)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: masayuki, Assigned: masayuki)
Details
(Keywords: inputmethod)
Attachments
(1 file)
|
1.89 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•12 years ago
|
||
| Assignee | ||
Comment 2•12 years ago
|
||
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)
Updated•12 years ago
|
Attachment #696260 -
Flags: review?(jmathies) → review+
| Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
(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.)
Comment 5•12 years ago
|
||
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.
Description
•