Closed Bug 1588810 Opened 3 months ago Closed 3 months ago

Don't assume null-terminated strings in UnicodeToNative

Categories

(Core :: js-ctypes, task)

task
Not set

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

We should use nsDependentSubstring instead of nsDependentString.

Bug 1586683 replaced the JS_FlattenString in the caller with JS_EnsureLinearString but
I wasn't aware of the nsDependentString vs nsDependentSubstring distinction.

This fixes assertion failures when starting the browser with non-null-terminated
JS strings.

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7014c7a657a3
Fix ctypes UnicodeToNative callback to not assume null-terminated strings. r=bzbarsky
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.