Pass the text length when creating an `nsString` from a SQLite text result

RESOLVED FIXED in Firefox 68

Status

()

defect
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: lina, Assigned: lina)

Tracking

unspecified
mozilla68
Points:
---

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

Something to do on the train ride home. 😄 I forgot to do this in https://phabricator.services.mozilla.com/D20073 (see this comment), and also fixed up the other callers while I was there.

Assignee

Comment 1

2 months ago

This commit updates mozStorage to always:

  • Pass the length, using sqlite3_{column, value}_bytes16, when
    creating an nsDependentString from a pointer.
  • Call sqlite3_{column, value}bytes{16} after
    sqlite3
    {column, value}_{text, blob, text16}, per the
    recommendation in https://www.sqlite.org/c3ref/column_blob.html.
    Some callers did this before, or in unclear order, since C++ doesn't
    specify one for evaluating function arguments.
  • Pass the byte length to sqlite3_result_text16.

Comment 2

2 months ago
Pushed by kcambridge@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b0a8a5c4533e
Pass the text length when creating an `nsString` from a SQLite text result. r=mak

Comment 3

2 months ago
bugherder
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.