Closed Bug 1600029 Opened 10 months ago Closed 10 months ago

IMContextWrapper::Selection::Assign assigns a string length as a character

Categories

(Core :: Widget: Gtk, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

Details

(Keywords: inputmethod)

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/4df8821c1b824db5f40f381f48432f219d99ae36/widget/gtk/IMContextWrapper.cpp#3134 says:

mString = aEvent.mReply.mString.Length();

which interprets the length of aEvent.mReply.mString as a UTF-16 code unit and makes mString a single-code unit string with that code unit. I think the line is meant not to have the .Length() bit.

When the length is zero, this causes IBus to assert, since we end up passing a pointer and length such that the pointer points to a zero code point, so strlen and the stated length (one) don't match. (Maybe we should have another bug to prevent strings with U+0000 in their logical content being passed to IBus?)

Assignee: nobody → hsivonen
Status: NEW → ASSIGNED

(In reply to Henri Sivonen (:hsivonen) from comment #0)

(Maybe we should have another bug to prevent strings with U+0000 in their logical content being passed to IBus?)

Filed as bug 1600031.

Keywords: inputmethod
OS: Unspecified → Linux
Hardware: Unspecified → All
Version: unspecified → Trunk
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/18959f602059
Avoid assigned string length as character in IMContextWrapper::Selection::Assign. r=masayuki
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.