Closed Bug 505278 Opened 11 years ago Closed 11 years ago

nsWifiAccessPoint::GetSsid doesn't do what it thinks it does with embedded nulls

Categories

(Core :: DOM: Geolocation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dougt)

Details

Attachments

(1 file)

nsWifiAccessPoint::GetSsid contains the following code:

  // just assign and embedded nulls will truncate resulting
  // in a displayable string.

  nsString tempStr;
  tempStr.AssignWithConversion(mSsid, mSsidLen);
  aSsid = tempStr;


I don't think this does what the comment says it does with embedded nulls; AssignWithConversion uses the passed in length as the length of the data, so I think this can include embedded nulls in the result.  If you want to get rid of embedded nulls, you probably just want to ignore mSsidLen and do:

  CopyASCIIToUTF16(mSsid, aSsid);
Attached patch patch v.1Splinter Review
Assignee: nobody → doug.turner
Attachment #389831 - Flags: review?
Attachment #389831 - Flags: review? → review?(dbaron)
Attachment #389831 - Flags: review?(dbaron) → review+
http://hg.mozilla.org/mozilla-central/rev/6a26645dc206
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Attachment #389831 - Flags: approval1.9.1.2?
Comment on attachment 389831 [details] [diff] [review]
patch v.1

Not for 1.9.1.2.
Attachment #389831 - Flags: approval1.9.1.2? → approval1.9.1.3?
Attachment #389831 - Flags: approval1.9.1.3? → approval1.9.1.4+
Comment on attachment 389831 [details] [diff] [review]
patch v.1

Approved for 1.9.1.4, a=dveditz for release-drivers
landing on 1.9.1.x will require code changes.  We added tests cases that will fail without them.  If we are interested, i can match what we have on 1.9.2
Comment on attachment 389831 [details] [diff] [review]
patch v.1

past code-freeze for 1.9.1.4, removing non-blocker approval.
Attachment #389831 - Flags: approval1.9.1.4+ → approval1.9.1.4-
You need to log in before you can comment on or make changes to this bug.