Don't use xpc_qsAString in IDB Key.h

RESOLVED FIXED in mozilla11

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

1.07 KB, patch
Ben Turner (not reading bugmail, use the needinfo flag!)
: review+
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
Created attachment 581063 [details] [diff] [review]
Patch v1

SetFromJSVal is currently the only user of xpc_qsAString outside of XPConnect.

Except for the additional API exposed, there are two problems with that. First, we don't check if IsValid() before using the string, which could (if I'm not mistaken, I may be) lead to dereferencing uninitialized memory in case of OOM, and second, there's really no need to invoke all the generic value -> string conversion code, because we already know we've got a string.

Fortunately, it can easily be replaced by nsDependentJSString.
Attachment #581063 - Flags: review?(bent.mozilla)
Attachment #581063 - Flags: review?(bent.mozilla) → review+
(Assignee)

Comment 1

6 years ago
https://hg.mozilla.org/mozilla-central/rev/d6a97d9eb14b
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.