Closed Bug 1586706 Opened 6 years ago Closed 6 years ago

Use QuoteString instead of StringToNewUTF8CharsZ when NUL characters are possible

Categories

(Core :: JavaScript: Internationalization API, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

https://phabricator.services.mozilla.com/D40067#inline-258336 proposed to use QuoteString instead of StringToNewUTF8CharsZ to properly handle resp. escape NUL characters. Because that suggestion not only applies to that patch, but actually to multiple other places, let's track it in a new bug.

QuoteString always returns an ASCII string, so we can also change JS_ReportErrorNumberUTF8
to JS_ReportErrorNumberASCII in a few places.

Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6d243ec1c977
Use QuoteString for JSString to char* conversion to ensure NUL characters don't cut off the result string. r=jwalden

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: